Commit f47807a5 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

cmd/go: skip _obj directories in package scans

Fixes #2693

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5557057
parent b58b5ba9
...@@ -327,9 +327,9 @@ func allPackages(pattern string) []string { ...@@ -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 { ...@@ -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
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment