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

Open
bcmills opened this issue Aug 10, 2020 · 1 comment
Open

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

bcmills opened this issue Aug 10, 2020 · 1 comment

Comments

@bcmills
Copy link
Member

@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:

example.com$ go version
go version devel +ba9e1088 Thu Aug 6 19:17:13 2020 +0000 linux/amd64

example.com$ 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

@jayconrod
Copy link
Contributor

@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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.