From: Russ Cox Date: Thu, 3 Nov 2016 03:31:08 +0000 (-0400) Subject: cmd/go: add version of GOROOT to go bug details X-Git-Tag: go1.8beta1~357 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fc2e282c04a3c36761254eb662bb20bad4eb4a35;p=gostls13.git cmd/go: add version of GOROOT to go bug details Fixes #15877. Change-Id: Ia1e327c0cea3be43e5f8ba637c97c223cee4bb5a Reviewed-on: https://go-review.googlesource.com/32643 TryBot-Result: Gobot Gobot Run-TryBot: Russ Cox Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/go/bug.go b/src/cmd/go/bug.go index 75fbf445bc..47f1d68bb7 100644 --- a/src/cmd/go/bug.go +++ b/src/cmd/go/bug.go @@ -44,6 +44,7 @@ func runBug(cmd *Command, args []string) { for _, e := range env { fmt.Fprintf(&buf, "%s=\"%s\"\n", e.name, e.value) } + printGoDetails(&buf) printOSDetails(&buf) printCDetails(&buf) fmt.Fprintln(&buf, "```") @@ -72,6 +73,11 @@ A link on play.golang.org is best. ` +func printGoDetails(w io.Writer) { + printCmdOut(w, "GOROOT/bin/go version: ", filepath.Join(runtime.GOROOT(), "bin/go"), "version") + printCmdOut(w, "GOROOT/bin/go tool compile -v: ", filepath.Join(runtime.GOROOT(), "bin/go"), "tool", "compile", "-V") +} + func printOSDetails(w io.Writer) { switch runtime.GOOS { case "darwin":