From 6b000abb881724a4b588f168dd824541d08b15c6 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Thu, 28 Nov 2024 20:23:57 +0100 Subject: [PATCH] govet: fix stdversion (#5168) --- pkg/goanalysis/runner_loadingpackage.go | 15 ++++++++------- pkg/golinters/govet/govet.go | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg/goanalysis/runner_loadingpackage.go b/pkg/goanalysis/runner_loadingpackage.go index 44d6769586e9..53ec6c0d6b7c 100644 --- a/pkg/goanalysis/runner_loadingpackage.go +++ b/pkg/goanalysis/runner_loadingpackage.go @@ -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) { diff --git a/pkg/golinters/govet/govet.go b/pkg/golinters/govet/govet.go index 451a055ebe1b..32fb8fb26bb0 100644 --- a/pkg/golinters/govet/govet.go +++ b/pkg/golinters/govet/govet.go @@ -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, @@ -128,6 +128,7 @@ var ( sigchanyzer.Analyzer, slog.Analyzer, stdmethods.Analyzer, + stdversion.Analyzer, stringintconv.Analyzer, structtag.Analyzer, testinggoroutine.Analyzer,