Closed jsternberg closed 6 years ago
cc @rsc @bcmills
Duplicate of #27479.
I think #27479 is a bit different, although they are certainly related. This issue has to do with the behavior of how modules are treated, module queries, and how the module versions are resolved when they are loaded from go.mod
. That other issue has to do with listing packages. As an example, this comment makes a lot more sense when you are talking about listing packages, but I'm not sure it makes sense when you are just trying to list the version of a module that's already specified in the go.mod
file since that issue doesn't have anything to do with how modules are resolved from go.mod
.
What did you do?
This is easiest to produce if you use docker because it's an issue when the go mod cache is empty.
gomods/athens
since I was playing with the registry.-json
below, but this also happens without-json
.What did you expect to see?
I did not expect it to evaluate each one of the versions for each module when it wasn't asked for them.
What did you see instead?
It ran the find algorithm on every single dependency in
go.mod
so you see a stream of things like this:If you are just trying to read the current module path, this slows things down a bunch when you have a new repository because it is attempting to find all of the possible versions for modules that it already has a version for.
It then finally prints the module path. But I only asked for the main module path. The
-json
output doesn't appear to use any information that it would retrieve from the above modules andgo.mod
already has the list of versions that it's going to use because there are no references to branches and there are no update operations to change the file. Thego list
command is also not being asked for it to evaluate imports.System details