From c3291436fa3bc9d4246ad2434b89496fd7c85089 Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Wed, 13 Apr 2016 11:15:14 +1000 Subject: [PATCH] cmd/tip: look for godoc binary under $GOPATH/bin instead of $GOROOT/bin A recent change to the cmd/go tool made it place godoc in $GOPATH/bin instead of the special-cased $GOROOT/bin. Change-Id: If026ff7e3a521ee2aa9b4107585124df108d7124 Reviewed-on: https://go-review.googlesource.com/21951 Reviewed-by: Brad Fitzpatrick --- cmd/tip/godoc.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/tip/godoc.go b/cmd/tip/godoc.go index ab3c3d2e..d16698cb 100644 --- a/cmd/tip/godoc.go +++ b/cmd/tip/godoc.go @@ -36,17 +36,18 @@ func (b godocBuilder) Init(dir, hostport string, heads map[string]string) (*exec return nil, err } goBin := filepath.Join(goDir, "bin/go") + goPath := filepath.Join(dir, "gopath") install := exec.Command(goBin, "install", "golang.org/x/tools/cmd/godoc") install.Env = []string{ "GOROOT=" + goDir, - "GOPATH=" + filepath.Join(dir, "gopath"), + "GOPATH=" + goPath, "GOROOT_BOOTSTRAP=" + os.Getenv("GOROOT_BOOTSTRAP"), } if err := runErr(install); err != nil { return nil, err } - godocBin := filepath.Join(goDir, "bin/godoc") + godocBin := filepath.Join(goPath, "bin/godoc") godoc := exec.Command(godocBin, "-http="+hostport, "-index", "-index_interval=-1s") godoc.Env = []string{"GOROOT=" + goDir} // TODO(adg): log this somewhere useful