]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add version of GOROOT to go bug details
authorRuss Cox <rsc@golang.org>
Thu, 3 Nov 2016 03:31:08 +0000 (23:31 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 3 Nov 2016 14:27:24 +0000 (14:27 +0000)
Fixes #15877.

Change-Id: Ia1e327c0cea3be43e5f8ba637c97c223cee4bb5a
Reviewed-on: https://go-review.googlesource.com/32643
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/go/bug.go

index 75fbf445bc383b56b1680c77856ca10affaa2a77..47f1d68bb7bb90783a5039c462267617f8ed85fb 100644 (file)
@@ -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":