diff --git a/impl.go b/impl.go index 9c91f7f..35ad309 100644 --- a/impl.go +++ b/impl.go @@ -220,12 +220,8 @@ func typeSpec(path, id string, typeParams []string, srcDir string) (Pkg, Spec, e cmap := ast.NewCommentMap(fset, f, f.Comments) for _, decl := range f.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - decl := genDecl - if decl.Tok != token.TYPE { + decl, ok := decl.(*ast.GenDecl) + if !ok || decl.Tok != token.TYPE { continue } for _, spec := range decl.Specs {