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
Labels
FeatureRequest GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bcmills
Copy link
Contributor

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

@bcmills bcmills added GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Aug 10, 2020
@bcmills bcmills added this to the Backlog milestone Aug 10, 2020
@jayconrod
Copy link
Contributor

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
Labels
FeatureRequest GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

2 participants