cmd/go: should go list -versions
list cached versions when GOPROXY=off?
#32337
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
modules
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
Users can set
GOPROXY=off
to disable module fetches. When that is set, however, they can still resolve versions that are already present in the local cache.However, it can be difficult to figure out what those versions actually are:
go list -versions -m $MODULE
produces unhelpful error output (#32335) if the module is not present in the proxy, and truncated output if the module is present:The workaround is to set
GOPROXY="file://$GOPATH/pkg/mod/cache/download"
before runninggo list
:Unfortunately, that's really not discoverable (Paul's example notwithstanding).
Instead, I propose that when
GOPROXY
is set tooff
,go list -versions
should list the versions that are available without consulting the proxy, as if the user had setGOPROXY="file://$GOPATH/pkg/mod/cache/download"
.I don't see any other reasonable behavior we could provide in that case, and that would turn an otherwise useless-in-context command into a useful one.
CC @jayconrod @hyangah @thepudds @myitcv @rsc
The text was updated successfully, but these errors were encountered: