-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.
Milestone
Description
The stdversion analyzer, which will soon become part of the vet suite (see https://go.dev/cl/582556), gives false positives when run on files that, although part of modules with recent Go versions, have old build tags. In this example from x/build, the file is tagged 1.16 even though the module requires go1.21.
stdversion should only honor the file version if it is greater than the module version. (And perhaps some other tool should warn when a file's build tag is so old that it becomes redundant with the module version.)
x/build$ go vet -c=0 ./cmd/coordinator
cmd/coordinator/buildstatus.go:1005:37: strings.Cut requires go1.18 or later (file is go1.16)
1005 switch pkg, variant, _ := strings.Cut(new, ":"); {
Metadata
Metadata
Assignees
Labels
AnalysisIssues related to static analysis (vet, x/tools/go/analysis)Issues related to static analysis (vet, x/tools/go/analysis)FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.