cmd/go: 'go list -deps all foo' erroneously loads test dependencies of packages imported by foo #40799
Labels
FrozenDueToAge
GoCommand
cmd/go
modules
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
go list -deps all foo
should list the dependencies of the packages inall
and the dependencies of packagefoo
, but should neither list nor attempt to resolve the test dependencies of other packages imported byfoo
.Similarly,
go list -deps -test all foo
should list the test dependencies of the packages inall
and the test dependencies offoo
itself, but not the test dependencies of other packages imported byfoo
.Today, it appears that
go list
erroneously resolves those dependencies, but successfully omits them from the listing. The erroneous resolution can be detected as a spurious change in thego.mod
file whenfoo
has an incomplete (“untidy”)go.mod
file.The test case below illustrates:
The text was updated successfully, but these errors were encountered: