summaryrefslogtreecommitdiff
path: root/src/cmd/go/main.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2012-01-31 17:40:36 -0500
committerRuss Cox <rsc@golang.org>2012-01-31 17:40:36 -0500
commit9602d330497faf5eb13a9cff0a23dd514ac78dac (patch)
tree11d8b175958cc9daf19f64439878e5107cd0adaf /src/cmd/go/main.go
parentffffd6a6961c237606cebf5f56abe9a0429fe918 (diff)
downloadgo-9602d330497faf5eb13a9cff0a23dd514ac78dac.tar.gz
cmd/go: improvements
Do not treat $GOROOT/src/pkg, $GOROOT/src/cmd, $GOPATH/src as package directories (only subdirectories of those can be package directories). Fixes issue 2602. Accept additional compiler and linker arguments during cgo from $CGO_CFLAGS and $CGO_LDFLAGS, as the Makefiles used to do. Show failed pkg-config output. Fixes issue 2785. Use different (perhaps better) git commands. Fixes issue 2109. R=golang-dev, r CC=golang-dev http://codereview.appspot.com/5605045
Diffstat (limited to 'src/cmd/go/main.go')
-rw-r--r--src/cmd/go/main.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go
index af9d6be48..68ab582df 100644
--- a/src/cmd/go/main.go
+++ b/src/cmd/go/main.go
@@ -347,7 +347,7 @@ func allPackages(pattern string) []string {
goroot := build.Path[0].Path
cmd := filepath.Join(goroot, "src/cmd") + string(filepath.Separator)
filepath.Walk(cmd, func(path string, fi os.FileInfo, err error) error {
- if err != nil || !fi.IsDir() {
+ if err != nil || !fi.IsDir() || path == cmd {
return nil
}
name := path[len(cmd):]
@@ -378,7 +378,7 @@ func allPackages(pattern string) []string {
}
src := t.SrcDir() + string(filepath.Separator)
filepath.Walk(src, func(path string, fi os.FileInfo, err error) error {
- if err != nil || !fi.IsDir() {
+ if err != nil || !fi.IsDir() || path == src {
return nil
}
@@ -445,7 +445,7 @@ func allPackagesInFS(pattern string) []string {
var pkgs []string
filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {
- if err != nil || !fi.IsDir() {
+ if err != nil || !fi.IsDir() || path == dir {
return nil
}