mirror of
https://github.com/golang/go
synced 2024-11-24 07:50:13 -07:00
test/garbage/parser: sync with recent parser changes
R=gri CC=golang-dev https://golang.org/cl/2144042
This commit is contained in:
parent
2eb00d57b4
commit
6f5f558c10
@ -30,11 +30,11 @@ func isPkgFile(dir *os.FileInfo) bool {
|
||||
}
|
||||
|
||||
func pkgName(filename string) string {
|
||||
file, err := parser.ParseFile(filename, nil, nil, parser.PackageClauseOnly)
|
||||
file, err := parser.ParseFile(filename, nil, parser.PackageClauseOnly)
|
||||
if err != nil || file == nil {
|
||||
return ""
|
||||
}
|
||||
return file.Name.Name()
|
||||
return file.Name.Name
|
||||
}
|
||||
|
||||
func parseDir(dirpath string) map[string]*ast.Package {
|
||||
|
Loading…
Reference in New Issue
Block a user