Skip to content

Commit 295c566

Browse files
shuLhanBryan C. Mills
authored and
Bryan C. Mills
committed
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] #31857 Fixes #29656 Change-Id: I609ad6664774018e4f4147ec6158485172968e16 Reviewed-on: https://go-review.googlesource.com/c/go/+/176837 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent 4ee4607 commit 295c566

File tree

1 file changed

+1
-0
lines changed
  • src/cmd/go/internal/envcmd

1 file changed

+1
-0
lines changed

src/cmd/go/internal/envcmd/env.go

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ func MkEnv() []cfg.EnvVar {
6666

6767
envFile, _ := cfg.EnvFile()
6868
env := []cfg.EnvVar{
69+
{Name: "GO111MODULE", Value: cfg.Getenv("GO111MODULE")},
6970
{Name: "GOARCH", Value: cfg.Goarch},
7071
{Name: "GOBIN", Value: cfg.GOBIN},
7172
{Name: "GOCACHE", Value: cache.DefaultDir()},

0 commit comments

Comments
 (0)