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: mod init outside of GOPATH silently fails #31342

Closed
ikkerens opened this issue Apr 8, 2019 · 1 comment
Closed

cmd/go: mod init outside of GOPATH silently fails #31342

ikkerens opened this issue Apr 8, 2019 · 1 comment
Labels
FrozenDueToAge modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@ikkerens
Copy link
Contributor

ikkerens commented Apr 8, 2019

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

$ go version
go version go1.12.2 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=C:\Users\Administrator\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Administrator\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
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 -fmessage-length=0 -fdebug-prefix-map=C:\Users\ADMINI~1\AppData\Local\Temp\go-build830287634=/tmp/go-build -gno-record-gcc-switches

What did you do?

$ cd /project/dir/outside/gopath
$ export GO111MODULE=off
$ go mod init

What did you expect to see?

An error that go modules are disabled, for example:
go: modules disabled by GO111MODULE=off; see 'go help modules'

What did you see instead?

Nothing, the command silently failed.


I have submitted a PR to fix this issue in #31255

@gopherbot
Copy link

Change https://golang.org/cl/170697 mentions this issue: cmd/go: mod init outside of GOPATH silently fails

@ALTree ALTree added the modules label Apr 9, 2019
@ALTree ALTree added this to the Go1.13 milestone Apr 9, 2019
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Apr 9, 2019
@golang golang locked and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants