Open jayconrod opened 4 years ago
@jayconrod, Is this an up for grabs then? Because I'd like to try this one.
@sibis Sure, feel free to take a look. I think it can mostly be done in src/cmd/go/internal/list/list.go
.
@version
turns out to be pretty easy, and I'm going to knock that out incidentally for #36460.
I think -versions
will require part of the implementation for #29666, though: at the moment, we don't distinguish between -m -json -versions
(which should also include information about the current version) and just -m -versions
(which, without a -f
template, does not need that information).
Change https://golang.org/cl/309191 mentions this issue: cmd/go/internal/modload: avoid loading the full module graph when listing specific modules
Change https://golang.org/cl/265777 mentions this issue: cmd/go/internal/modload: implement lazy loading
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Both the
go list -m
commands above should succeed.What did you see instead?
Both commands fail. This happens because
go list -m
loads the build list before processing arguments.go.sum
is missing, so that fails.There's no need to load the build list for these commands. They both succeed when run outside a module or when
go.mod
contains no requirements.