diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index fce16ba08454c..70ec9c94dac04 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -7,4 +7,3 @@ upup/pkg/fi upup/pkg/fi/cloudup upup/pkg/fi/cloudup/awstasks upup/pkg/kutil -upup/tools/generators/pkg/codegen diff --git a/upup/tools/generators/pkg/codegen/parse.go b/upup/tools/generators/pkg/codegen/parse.go index 928016606c730..24b0a16ee0780 100644 --- a/upup/tools/generators/pkg/codegen/parse.go +++ b/upup/tools/generators/pkg/codegen/parse.go @@ -36,9 +36,6 @@ type GoParser struct { type File struct { pkg *Package // Package to which this file belongs. file *ast.File // Parsed AST. - // These fields are reset for each type being generated. - typeName string // Name of the constant type. - //values []Value // Accumulator for constant values of that type. } type Package struct { @@ -110,7 +107,7 @@ func (g *GoParser) parsePackage(directory string, names []string, text interface // check type-checks the package. The package must be OK to proceed. func (pkg *Package) check(fs *token.FileSet, astFiles []*ast.File) { pkg.defs = make(map[*ast.Ident]types.Object) - config := types.Config{Importer: importer.For("source", nil), FakeImportC: true} + config := types.Config{Importer: importer.ForCompiler(token.NewFileSet(), "source", nil), FakeImportC: true} info := &types.Info{ Defs: pkg.defs, }