cmd/go: 'go get' of non-main packages outside of a module is confusing in module mode #47290
Labels
FrozenDueToAge
GoCommand
cmd/go
help wanted
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
In module mode today,
go get
on a non-main
package downloads that package to the module cache, builds that package (until we finish #43684), and leaves it in the build cache.This behavior can be confusing for users who are working from older, GOPATH-based materials (as in https://stackoverflow.com/q/68420141). In GOPATH mode this would have cloned the package's source repo to
GOPATH/src
, but in module mode it instead downloads the module containing the source to a versioned path withinGOPATH/pkg/mod
.If
go get
is invoked on a non-main
package in module mode outside of any module, we should probably at least log a message indicating where the source code is now found.CC @jayconrod @matloob
The text was updated successfully, but these errors were encountered: