export GOPATH=$(pwd)/gopath
export GO111MODULE=auto
go get -d -overlay=overlay.json rsc.io/quote
-- overlay.json --
{
"Replace": {
"go.mod": "go-overlay.mod"
}
}
-- go-overlay.mod --
module test
go 1.16
What did you expect to see?
go get should run in module-aware mode because GO111MODULE is auto, and a go.mod file is present in the overlay. It should report an error that go.mod in the overlay cannot be modified.
What did you see instead?
go get gets confused about whether it's in module-aware mode and panics.
This happens because internally, there are two distinct go get subcommands. When GO111MODULE is auto, the go command looks for a go.mod to decide which to use. This happens before flags are parsed and the overlay is initialized though.
cc @matloob@bcmills. This is pretty low priority though: I don't expect anyone to run into this in practice.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
go get
should run in module-aware mode becauseGO111MODULE
isauto
, and ago.mod
file is present in the overlay. It should report an error thatgo.mod
in the overlay cannot be modified.What did you see instead?
go get
gets confused about whether it's in module-aware mode and panics.The text was updated successfully, but these errors were encountered: