1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:17:57 -07:00
Change-Id: Ib9b2a8b6b4c7ef711bc4710c18a74556cde0117c
This commit is contained in:
qiulaidongfeng 2024-04-02 22:20:21 +08:00
parent d42ad790d9
commit 88222bd8d0

View File

@ -17,7 +17,6 @@ import (
"go/parser" "go/parser"
"go/token" "go/token"
"go/types" "go/types"
"internal/singleflight"
"internal/testenv" "internal/testenv"
"io" "io"
"log" "log"
@ -386,7 +385,6 @@ func (w *Walker) Features() (fs []string) {
var parsedFileCache struct { var parsedFileCache struct {
lock sync.RWMutex lock sync.RWMutex
m map[string]*ast.File m map[string]*ast.File
wg singleflight.Group
} }
func init() { func init() {
@ -411,6 +409,7 @@ func (w *Walker) parseFile(dir, file string) (*ast.File, error) {
parsedFileCache.m[filename] = f parsedFileCache.m[filename] = f
} }
parsedFileCache.lock.Unlock() parsedFileCache.lock.Unlock()
return f, nil return f, nil
} }