internal/build: ignore some files in FindMainPackages (#27521)
This commit is contained in:
parent
b1ef0bfe03
commit
84b05d4f34
@ -197,6 +197,9 @@ func FindMainPackages(dir string) []string {
|
|||||||
}
|
}
|
||||||
for _, cmd := range cmds {
|
for _, cmd := range cmds {
|
||||||
pkgdir := filepath.Join(dir, cmd.Name())
|
pkgdir := filepath.Join(dir, cmd.Name())
|
||||||
|
if !cmd.IsDir() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
pkgs, err := parser.ParseDir(token.NewFileSet(), pkgdir, nil, parser.PackageClauseOnly)
|
pkgs, err := parser.ParseDir(token.NewFileSet(), pkgdir, nil, parser.PackageClauseOnly)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user