mirror of
https://github.com/golang/go
synced 2024-11-20 09:34:52 -07:00
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>
This commit is contained in:
parent
89ccd5795c
commit
fc2e282c04
@ -44,6 +44,7 @@ func runBug(cmd *Command, args []string) {
|
|||||||
for _, e := range env {
|
for _, e := range env {
|
||||||
fmt.Fprintf(&buf, "%s=\"%s\"\n", e.name, e.value)
|
fmt.Fprintf(&buf, "%s=\"%s\"\n", e.name, e.value)
|
||||||
}
|
}
|
||||||
|
printGoDetails(&buf)
|
||||||
printOSDetails(&buf)
|
printOSDetails(&buf)
|
||||||
printCDetails(&buf)
|
printCDetails(&buf)
|
||||||
fmt.Fprintln(&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) {
|
func printOSDetails(w io.Writer) {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
|
Loading…
Reference in New Issue
Block a user