mirror of
https://github.com/golang/go
synced 2024-11-18 22:04:43 -07:00
cmd/go: show $GOPATH in 'go env' output
Also, sort output. R=golang-dev, patrick, dave, iant CC=golang-dev, patrick https://golang.org/cl/6446064
This commit is contained in:
parent
e53351013d
commit
7711e61031
@ -6,6 +6,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -33,16 +34,17 @@ func mkEnv() []envVar {
|
|||||||
b.init()
|
b.init()
|
||||||
|
|
||||||
env := []envVar{
|
env := []envVar{
|
||||||
{"GOROOT", goroot},
|
|
||||||
{"GOBIN", gobin},
|
|
||||||
{"GOARCH", goarch},
|
{"GOARCH", goarch},
|
||||||
|
{"GOBIN", gobin},
|
||||||
{"GOCHAR", archChar},
|
{"GOCHAR", archChar},
|
||||||
{"GOOS", goos},
|
|
||||||
{"GOEXE", exeSuffix},
|
{"GOEXE", exeSuffix},
|
||||||
|
{"GOGCCFLAGS", strings.Join(b.gccCmd(".")[3:], " ")},
|
||||||
{"GOHOSTARCH", runtime.GOARCH},
|
{"GOHOSTARCH", runtime.GOARCH},
|
||||||
{"GOHOSTOS", runtime.GOOS},
|
{"GOHOSTOS", runtime.GOOS},
|
||||||
|
{"GOOS", goos},
|
||||||
|
{"GOPATH", os.Getenv("GOPATH")},
|
||||||
|
{"GOROOT", goroot},
|
||||||
{"GOTOOLDIR", toolDir},
|
{"GOTOOLDIR", toolDir},
|
||||||
{"GOGCCFLAGS", strings.Join(b.gccCmd(".")[3:], " ")},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if buildContext.CgoEnabled {
|
if buildContext.CgoEnabled {
|
||||||
|
Loading…
Reference in New Issue
Block a user