Skip to content

Commit 3f35e26

Browse files
committed
Fix upup/tools/generators/pkg/codegen staticcheck failures
1 parent 1eb9b7d commit 3f35e26

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

hack/.staticcheck_failures

-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ upup/pkg/fi
99
upup/pkg/fi/cloudup
1010
upup/pkg/fi/cloudup/awstasks
1111
upup/pkg/kutil
12-
upup/tools/generators/pkg/codegen

upup/tools/generators/pkg/codegen/parse.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ type GoParser struct {
3636
type File struct {
3737
pkg *Package // Package to which this file belongs.
3838
file *ast.File // Parsed AST.
39-
// These fields are reset for each type being generated.
40-
typeName string // Name of the constant type.
41-
//values []Value // Accumulator for constant values of that type.
4239
}
4340

4441
type Package struct {
@@ -110,7 +107,7 @@ func (g *GoParser) parsePackage(directory string, names []string, text interface
110107
// check type-checks the package. The package must be OK to proceed.
111108
func (pkg *Package) check(fs *token.FileSet, astFiles []*ast.File) {
112109
pkg.defs = make(map[*ast.Ident]types.Object)
113-
config := types.Config{Importer: importer.For("source", nil), FakeImportC: true}
110+
config := types.Config{Importer: importer.ForCompiler(token.NewFileSet(), "source", nil), FakeImportC: true}
114111
info := &types.Info{
115112
Defs: pkg.defs,
116113
}

0 commit comments

Comments
 (0)