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

Comments

Projects
None yet
3 participants
@ikkerens
Copy link
Contributor

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

This comment has been minimized.

Copy link

commented Apr 8, 2019

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 label Apr 9, 2019

@gopherbot gopherbot closed this in 3e2ceaf Apr 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.