From: Andrew Gerrand Date: Tue, 2 Aug 2011 02:17:23 +0000 (-0700) Subject: go/build: use GOBIN as binary path for GOROOT X-Git-Tag: weekly.2011-08-10~47 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b0ef0294d2b0080b1b9bfa073e61d1e7c509eb3b;p=gostls13.git go/build: use GOBIN as binary path for GOROOT Fixes #2106. R=golang-dev, dsymonds, rsc CC=golang-dev https://golang.org/cl/4836047 --- diff --git a/src/pkg/go/build/path.go b/src/pkg/go/build/path.go index 7c120d064c..e39b5f8fa5 100644 --- a/src/pkg/go/build/path.go +++ b/src/pkg/go/build/path.go @@ -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") }