Skip to content

Commit fc2e282

Browse files
committed
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 <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
1 parent 89ccd57 commit fc2e282

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cmd/go/bug.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func runBug(cmd *Command, args []string) {
4444
for _, e := range env {
4545
fmt.Fprintf(&buf, "%s=\"%s\"\n", e.name, e.value)
4646
}
47+
printGoDetails(&buf)
4748
printOSDetails(&buf)
4849
printCDetails(&buf)
4950
fmt.Fprintln(&buf, "```")
@@ -72,6 +73,11 @@ A link on play.golang.org is best.
7273
7374
`
7475

76+
func printGoDetails(w io.Writer) {
77+
printCmdOut(w, "GOROOT/bin/go version: ", filepath.Join(runtime.GOROOT(), "bin/go"), "version")
78+
printCmdOut(w, "GOROOT/bin/go tool compile -v: ", filepath.Join(runtime.GOROOT(), "bin/go"), "tool", "compile", "-V")
79+
}
80+
7581
func printOSDetails(w io.Writer) {
7682
switch runtime.GOOS {
7783
case "darwin":

0 commit comments

Comments
 (0)