Skip to content

Commit

Permalink
govet: fix stdversion (#5168)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Nov 28, 2024
1 parent 87c0a44 commit 6b000ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions pkg/goanalysis/runner_loadingpackage.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,14 @@ func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error {
pkg.IllTyped = true

pkg.TypesInfo = &types.Info{
Types: make(map[ast.Expr]types.TypeAndValue),
Instances: make(map[*ast.Ident]types.Instance),
Defs: make(map[*ast.Ident]types.Object),
Uses: make(map[*ast.Ident]types.Object),
Implicits: make(map[ast.Node]types.Object),
Scopes: make(map[ast.Node]*types.Scope),
Selections: make(map[*ast.SelectorExpr]*types.Selection),
Types: make(map[ast.Expr]types.TypeAndValue),
Instances: make(map[*ast.Ident]types.Instance),
Defs: make(map[*ast.Ident]types.Object),
Uses: make(map[*ast.Ident]types.Object),
Implicits: make(map[ast.Node]types.Object),
Selections: make(map[*ast.SelectorExpr]*types.Selection),
Scopes: make(map[ast.Node]*types.Scope),
FileVersions: make(map[*ast.File]string),
}

importer := func(path string) (*types.Package, error) {
Expand Down
3 changes: 2 additions & 1 deletion pkg/golinters/govet/govet.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var (
unusedwrite.Analyzer,
}

// https://github.com/golang/go/blob/b56645a87b28840a180d64077877cb46570b4176/src/cmd/vet/main.go#L49-L81
// https://github.com/golang/go/blob/go1.23.0/src/cmd/vet/main.go#L55-L87
defaultAnalyzers = []*analysis.Analyzer{
appends.Analyzer,
asmdecl.Analyzer,
Expand All @@ -128,6 +128,7 @@ var (
sigchanyzer.Analyzer,
slog.Analyzer,
stdmethods.Analyzer,
stdversion.Analyzer,
stringintconv.Analyzer,
structtag.Analyzer,
testinggoroutine.Analyzer,
Expand Down

0 comments on commit 6b000ab

Please # to comment.