Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go env should include GO111MODULE #29656

Closed
xiaoxiaoyijian123456 opened this issue Jan 10, 2019 · 9 comments
Closed

cmd/go: go env should include GO111MODULE #29656

xiaoxiaoyijian123456 opened this issue Jan 10, 2019 · 9 comments
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@xiaoxiaoyijian123456
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.12beta1 windows/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=F:\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=F:\GOPATH
set GOPROXY=https://goproxy.io
set GORACE=
set GOROOT=E:\Go
set GOTMPDIR=
set GOTOOLDIR=E:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=F:\GOPATH\src\github.com\go-steven\sanle\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\m1358\AppData\Local\Temp\go-build806091146=/tmp/go-build -gno-record-gcc-switches

What did you do?

I have already set the environment variable GO111MODULE to on, but there's no GO111MODULE printed in go env.

What did you expect to see?

go env should print GO111MODULE in Go1.11/1.12...

What did you see instead?

No GO111MODULE printed in go env.

@ALTree ALTree added this to the Go1.13 milestone Jan 10, 2019
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Jan 10, 2019
@ALTree
Copy link
Member

ALTree commented Jan 10, 2019

GO111MODULE is a temporary env variable that was introduced to help ensure a smooth transition to the module system. I believe we never bothered adding this kind of temporary env vars to go env.

@ALTree
Copy link
Member

ALTree commented Jan 10, 2019

cc @bcmills for decision since you're asking for 1.12 which is almost done.

@bcmills
Copy link
Contributor

bcmills commented Jan 10, 2019

Why do you need it from go env rather than calling os.Getenv?

It would make module-related issues a bit easier to report, but at this point that seems like relatively little gain, and the environment variable hopefully won't be around forever.

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jan 10, 2019
@xiaoxiaoyijian123456
Copy link
Author

OK, it is just a little problem. Close it.

@shuLhan
Copy link
Contributor

shuLhan commented May 13, 2019

@bcmills , Ah ... I may have accidentally skip this when searching for issue. My bad.

If I can argue, even its temporary, 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.

BTW, thank you for reviewing the CL.

[1] #31857
[2] https://go-review.googlesource.com/c/go/+/176837

@bcmills bcmills reopened this May 14, 2019
@bcmills bcmills added modules and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels May 14, 2019
@bcmills bcmills changed the title cmd/go: go env should print GO111MODULE in Go1.11/1.12... cmd/go: go env should include GO111MODULE May 14, 2019
@bcmills
Copy link
Contributor

bcmills commented May 14, 2019

CC @jayconrod

@jayconrod
Copy link
Contributor

Why is go env GO111MODULE actually needed? If you need to check whether modules are enabled, go env GOMOD is a better way to do that.

@gopherbot
Copy link

Change https://golang.org/cl/176837 mentions this issue: internal/envcmd: print GO111MODULE when executing "go env"

@rsc
Copy link
Contributor

rsc commented May 16, 2019

Yes please, if only so it shows up in 'go bug' reports so we can better diagnose problems.

@bcmills bcmills added the NeedsFix The path to resolution is known, but the work has not been done. label May 16, 2019
@gopherbot gopherbot removed the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label May 16, 2019
@golang golang locked and limited conversation to collaborators May 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

7 participants