Skip to content

cmd/vet: reported typecheck errors not sorted by file position #26236

Description

@rsc

Compare gc and vet typecheck errors:

$ go test
# golang.org/x/vgo2/vendor/cmd/go/internal/modfetch [golang.org/x/vgo2/vendor/cmd/go/internal/modfetch.test]
./coderepo.go:279:70: undefined: file2
./coderepo.go:294:8: no new variables on left side of :=
./coderepo.go:294:30: undefined: gomod
# golang.org/x/vgo2/vendor/cmd/go/internal/modfetch
./coderepo.go:294:30: undeclared name: gomod
./coderepo.go:294:8: no new variables on left side of :=
./coderepo.go:279:70: undeclared name: file2
vet: typecheck failures

(go test printing both sets at all is a different issue, but it is nice for seeing how they compare.)

It's weird that the errors from vet come out not sorted in file line order. They should.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnalysisIssues related to static analysis (vet, x/tools/go/analysis)NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions