1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:07:56 -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:
Brad Fitzpatrick 2012-01-18 19:27:16 -08:00
parent b58b5ba997
commit f47807a57f

View File

@ -327,9 +327,9 @@ func allPackages(pattern string) []string {
return nil
}
// Avoid .foo and testdata directory trees.
// Avoid .foo, _foo, and testdata directory trees.
_, elem := filepath.Split(path)
if strings.HasPrefix(elem, ".") || elem == "testdata" {
if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
return filepath.SkipDir
}
@ -394,9 +394,9 @@ func allPackagesInFS(pattern string) []string {
return nil
}
// Avoid .foo and testdata directory trees.
// Avoid .foo, _foo, and testdata directory trees.
_, elem := filepath.Split(path)
if strings.HasPrefix(elem, ".") || elem == "testdata" {
if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" {
return filepath.SkipDir
}