Skip to content

Commit 6b000ab

Browse files
authored
govet: fix stdversion (#5168)
1 parent 87c0a44 commit 6b000ab

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

pkg/goanalysis/runner_loadingpackage.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,14 @@ func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error {
125125
pkg.IllTyped = true
126126

127127
pkg.TypesInfo = &types.Info{
128-
Types: make(map[ast.Expr]types.TypeAndValue),
129-
Instances: make(map[*ast.Ident]types.Instance),
130-
Defs: make(map[*ast.Ident]types.Object),
131-
Uses: make(map[*ast.Ident]types.Object),
132-
Implicits: make(map[ast.Node]types.Object),
133-
Scopes: make(map[ast.Node]*types.Scope),
134-
Selections: make(map[*ast.SelectorExpr]*types.Selection),
128+
Types: make(map[ast.Expr]types.TypeAndValue),
129+
Instances: make(map[*ast.Ident]types.Instance),
130+
Defs: make(map[*ast.Ident]types.Object),
131+
Uses: make(map[*ast.Ident]types.Object),
132+
Implicits: make(map[ast.Node]types.Object),
133+
Selections: make(map[*ast.SelectorExpr]*types.Selection),
134+
Scopes: make(map[ast.Node]*types.Scope),
135+
FileVersions: make(map[*ast.File]string),
135136
}
136137

137138
importer := func(path string) (*types.Package, error) {

pkg/golinters/govet/govet.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ var (
103103
unusedwrite.Analyzer,
104104
}
105105

106-
// https://github.com/golang/go/blob/b56645a87b28840a180d64077877cb46570b4176/src/cmd/vet/main.go#L49-L81
106+
// https://github.com/golang/go/blob/go1.23.0/src/cmd/vet/main.go#L55-L87
107107
defaultAnalyzers = []*analysis.Analyzer{
108108
appends.Analyzer,
109109
asmdecl.Analyzer,
@@ -128,6 +128,7 @@ var (
128128
sigchanyzer.Analyzer,
129129
slog.Analyzer,
130130
stdmethods.Analyzer,
131+
stdversion.Analyzer,
131132
stringintconv.Analyzer,
132133
structtag.Analyzer,
133134
testinggoroutine.Analyzer,

0 commit comments

Comments
 (0)