From f47807a57f9dacab74ebf7e9d86f3dc0dcb933b0 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 18 Jan 2012 19:27:16 -0800 Subject: [PATCH] cmd/go: skip _obj directories in package scans Fixes #2693 R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5557057 --- src/cmd/go/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go index 8ef6395f4f7..fdea80916f5 100644 --- a/src/cmd/go/main.go +++ b/src/cmd/go/main.go @@ -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 }