cmd/go/internal/modload: spurious "package provided … at latest version but not at required version" errors #41113
Labels
FrozenDueToAge
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
There appears to be a bug in our logic for determining whether a package can be resolved by adding a module.
This loop sets
newMissingVersion
on the returnedImportMissingError
if any of the candidates returned byQueryPackage
is required at a higher version in the build list.However, if there are multiple (nested) candidate modules and only one is required at a higher version (as in the case of a module split without a requirement cycle; see also #27899), we should suggest adding one of the candidates that is viable, rather than rejecting all of them with a
newMissingVersion
error.This bug was found by code inspection while working on #36460, so I still need to find a test case that reproduces it.
CC @matloob @jayconrod
The text was updated successfully, but these errors were encountered: