aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2011-08-01 19:17:23 -0700
committerAndrew Gerrand <adg@golang.org>2011-08-01 19:17:23 -0700
commitb0ef0294d2b0080b1b9bfa073e61d1e7c509eb3b (patch)
treeb1b2247fe54f3a6635f6d4979c388ef3244268f6
parent034711ed763339e4a9bc068fba09d0441fde348f (diff)
downloadgo-b0ef0294d2b0080b1b9bfa073e61d1e7c509eb3b.tar.gz
go-b0ef0294d2b0080b1b9bfa073e61d1e7c509eb3b.zip
go/build: use GOBIN as binary path for GOROOT
Fixes #2106. R=golang-dev, dsymonds, rsc CC=golang-dev https://golang.org/cl/4836047
-rw-r--r--src/pkg/go/build/path.go5
1 files changed, 5 insertions, 0 deletions
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")
}