From b0ef0294d2b0080b1b9bfa073e61d1e7c509eb3b Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Mon, 1 Aug 2011 19:17:23 -0700 Subject: [PATCH] go/build: use GOBIN as binary path for GOROOT Fixes #2106. R=golang-dev, dsymonds, rsc CC=golang-dev https://golang.org/cl/4836047 --- src/pkg/go/build/path.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pkg/go/build/path.go b/src/pkg/go/build/path.go index 7c120d064cb..e39b5f8fa57 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") }