]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: show $GOPATH in 'go env' output
authorRuss Cox <rsc@golang.org>
Mon, 30 Jul 2012 04:22:42 +0000 (00:22 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 30 Jul 2012 04:22:42 +0000 (00:22 -0400)
Also, sort output.

R=golang-dev, patrick, dave, iant
CC=golang-dev, patrick
https://golang.org/cl/6446064

src/cmd/go/env.go

index d5b0348096c325d08845c81a5717e2160783bf6c..3e51674f75440abfbf8381923ebcd5dd0eb93ee3 100644 (file)
@@ -6,6 +6,7 @@ package main
 
 import (
        "fmt"
+       "os"
        "runtime"
        "strings"
 )
@@ -33,16 +34,17 @@ func mkEnv() []envVar {
        b.init()
 
        env := []envVar{
-               {"GOROOT", goroot},
-               {"GOBIN", gobin},
                {"GOARCH", goarch},
+               {"GOBIN", gobin},
                {"GOCHAR", archChar},
-               {"GOOS", goos},
                {"GOEXE", exeSuffix},
+               {"GOGCCFLAGS", strings.Join(b.gccCmd(".")[3:], " ")},
                {"GOHOSTARCH", runtime.GOARCH},
                {"GOHOSTOS", runtime.GOOS},
+               {"GOOS", goos},
+               {"GOPATH", os.Getenv("GOPATH")},
+               {"GOROOT", goroot},
                {"GOTOOLDIR", toolDir},
-               {"GOGCCFLAGS", strings.Join(b.gccCmd(".")[3:], " ")},
        }
 
        if buildContext.CgoEnabled {