Skip to content

Commit

Permalink
Merge pull request #8203 from johngmyers/codegen-staticcheck
Browse files Browse the repository at this point in the history
Fix upup/tools/generators/pkg/codegen staticcheck failures
  • Loading branch information
k8s-ci-robot authored Dec 27, 2019
2 parents ac76e81 + 3f35e26 commit 0377b58
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion hack/.staticcheck_failures
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ upup/pkg/fi
upup/pkg/fi/cloudup
upup/pkg/fi/cloudup/awstasks
upup/pkg/kutil
upup/tools/generators/pkg/codegen
5 changes: 1 addition & 4 deletions upup/tools/generators/pkg/codegen/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
}
Expand Down

0 comments on commit 0377b58

Please sign in to comment.