cmd/vet: GoVersion=="" on standard library packages #64293
Labels
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Within standard library packages the GoVersion sent to unitchecker is "" for standard library packages. This can be recreated from
gotip vet -x ./...
from$GOROOT/src
(which will be in a module).This
GoVersion
is passed along togo/types
intypes.Config
. When this is empty (which is an invalid version),(*types.Info).FileVersions
is not populated. Theloopclosure
vet check usesFileVersions
to decide what is the semantics of a given for loop is. So there will now be a divergence in behavior for cmd/vet when running on the standard libraries.The relevant code to set the field is in
buildVetConfig
:A hunch for why
a.Package.Module
is nil is that it comes fromPackageModuleInfo
which documents that nil is expected:cc @bcmills
The text was updated successfully, but these errors were encountered: