aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/envcmd/env.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2019-05-10 22:38:56 +0700
committerBryan C. Mills <bcmills@google.com>2019-05-20 15:38:52 +0000
commit295c56627afaa9db19ee7fcb0df33c1d6fa3c9fa (patch)
treebf8be397fda79b10a64002e14da6f42856454694 /src/cmd/go/internal/envcmd/env.go
parent4ee4607c97a3968b7252fbcac4631a6b6b7b4537 (diff)
downloadgo-295c56627afaa9db19ee7fcb0df33c1d6fa3c9fa.tar.gz
go-295c56627afaa9db19ee7fcb0df33c1d6fa3c9fa.zip
internal/envcmd: print GO111MODULE when executing "go env"
If we look at the issues in the past releases that are related to go command that involved modules, its usually mention or ask about the value of GO111MODULE, either in separate line or in separate comment. There are quite long time range before GO111MODULE will be removed (unused). The next release is still default to auto [1], and until Go 1.13 unsupported (two releases after that) there is about one and half years after that. Since the change is not that big (one line) [2], maybe temporary adding it to "go env" give more clarity and benefit in issue reporting rather than not. [1] https://github.com/golang/go/issues/31857 Fixes #29656 Change-Id: I609ad6664774018e4f4147ec6158485172968e16 Reviewed-on: https://go-review.googlesource.com/c/go/+/176837 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/go/internal/envcmd/env.go')
-rw-r--r--src/cmd/go/internal/envcmd/env.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go
index 00f10977bb..b3d12dd681 100644
--- a/src/cmd/go/internal/envcmd/env.go
+++ b/src/cmd/go/internal/envcmd/env.go
@@ -66,6 +66,7 @@ func MkEnv() []cfg.EnvVar {
envFile, _ := cfg.EnvFile()
env := []cfg.EnvVar{
+ {Name: "GO111MODULE", Value: cfg.Getenv("GO111MODULE")},
{Name: "GOARCH", Value: cfg.Goarch},
{Name: "GOBIN", Value: cfg.GOBIN},
{Name: "GOCACHE", Value: cache.DefaultDir()},