]> Cypherpunks repositories - gostls13.git/commitdiff
go/build: use GOBIN as binary path for GOROOT
authorAndrew Gerrand <adg@golang.org>
Tue, 2 Aug 2011 02:17:23 +0000 (19:17 -0700)
committerAndrew Gerrand <adg@golang.org>
Tue, 2 Aug 2011 02:17:23 +0000 (19:17 -0700)
Fixes #2106.

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/4836047

src/pkg/go/build/path.go

index 7c120d064cb0ae1514f59ac0b6637c3a5fd9bedb..e39b5f8fa575e2f70bc21cb03bc50cfe1f4a353c 100644 (file)
@@ -54,6 +54,11 @@ func (t *Tree) PkgDir() string {
 
 // BinDir returns the tree's binary executable directory.
 func (t *Tree) BinDir() string {
+       if t.Goroot {
+               if gobin := os.Getenv("GOBIN"); gobin != "" {
+                       return gobin
+               }
+       }
        return filepath.Join(t.Path, "bin")
 }