Commit 7711e610 authored by Russ Cox's avatar Russ Cox

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
parent e5335101
...@@ -6,6 +6,7 @@ package main ...@@ -6,6 +6,7 @@ package main
import ( import (
"fmt" "fmt"
"os"
"runtime" "runtime"
"strings" "strings"
) )
...@@ -33,16 +34,17 @@ func mkEnv() []envVar { ...@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment