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: allow 'go list' to accept '-u' without '-m' #40676

bcmills opened this issue Aug 10, 2020 · 1 comment

cmd/go: allow 'go list' to accept '-u' without '-m' #40676

bcmills opened this issue Aug 10, 2020 · 1 comment


Copy link

@bcmills bcmills commented Aug 10, 2020

go list with the -f flag can print a lot of information about the module associated with a package.

Unfortunately, we don't populate the Module.Update field unless the -u flag is set, and the -u flag can only be set today if the -m flag is also set:$ go version
go version devel +ba9e1088 Thu Aug 6 19:17:13 2020 +0000 linux/amd64$ go list -u -f '{{with .Module}}{{with .Update}}{{.}}{{end}}{{end}}' ./... | sort -u
go list -u can only be used with -m

We should investigate whether it is feasible to allow the -u flag without -m. That would probably require a hook to instruct the package loader to compute upgrade information.

CC @jayconrod @matloob @komuw

Copy link

@jayconrod jayconrod commented Aug 10, 2020

Huh, I thought this worked already. Guess not.

CL 228382 adds the go list -retracted flag, and it gets us part of the way there. When -retracted is given without -m, it loads retractions for each module providing packages named on the command line. That code could be extended to work with either -retracted or -u.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants