mirror of
https://github.com/golang/go
synced 2024-11-25 10:57:58 -07:00
cmd/go: skip _obj directories in package scans
Fixes #2693 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5557057
This commit is contained in:
parent
b58b5ba997
commit
f47807a57f
@ -327,9 +327,9 @@ func allPackages(pattern string) []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Avoid .foo and testdata directory trees.
|
// Avoid .foo, _foo, and testdata directory trees.
|
||||||
_, elem := filepath.Split(path)
|
_, elem := filepath.Split(path)
|
||||||
if strings.HasPrefix(elem, ".") || elem == "testdata" {
|
if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,9 +394,9 @@ func allPackagesInFS(pattern string) []string {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Avoid .foo and testdata directory trees.
|
// Avoid .foo, _foo, and testdata directory trees.
|
||||||
_, elem := filepath.Split(path)
|
_, elem := filepath.Split(path)
|
||||||
if strings.HasPrefix(elem, ".") || elem == "testdata" {
|
if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
|
||||||
return filepath.SkipDir
|
return filepath.SkipDir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user