-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: allow versioned 'go list' commands #44203
Comments
I can see some use for this feature, it's consistent with the recent change to I'm curious to see what @jayconrod and @matloob think, but at this point it seems ok to me. |
Seems fine to me. Though I think we should talk about allowing The main difference is that As a starting point, I think it should do what |
I think that makes sense too, and @dominikh seemed to also agree on Slack. I thought we could start with just
Sounds good to me. From the caller's point of view, if they want to do MVS resolution separately for a number of arguments, they could just use separate |
Somewhat related to the version suffix support: |
If the required semantics of the |
I think it's okay for
In @hyangah's example of |
#40276 allows using
go install path@version
to install a package at a specific version, ignoring the current module.#42088 is an accepted proposal to allow
go run path@version
with similar semantics - run a main package at a specific version, ignoring the current module.While I agree that these semantics are most often useful for
go install
andgo run
, I argue that they would also be useful for other cmd/go commands. In this proposal, I want to make a case forgo list path@version
.The main use case I want to bring forth is to list the packages included in a specific version of a module. Right now, I can only accomplish this via:
It could instead be just
go list ${module}/...@${version}
.For reference, I'm using this to generate static HTML pages to serve
go get
and browser requests for vanity import paths; see https://github.com/mvdan/mvdan.cc/blob/572593964513b20649c474cc9a6559405ec9cc29/gen-go-modules.bash#L49-L53.I think this feature would also make
go list
a bit more consistent, sincego list -m path@version
currently works just fine./cc @dominikh @bcmills @jayconrod @myitcv @eliasnaur
The text was updated successfully, but these errors were encountered: