Skip to content

Commit

Permalink
cmd/go: skip _obj directories in package scans
Browse files Browse the repository at this point in the history
Fixes #2693

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5557057
  • Loading branch information
bradfitz committed Jan 19, 2012
1 parent b58b5ba commit f47807a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cmd/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit f47807a

Please sign in to comment.