@@ -162,9 +162,7 @@ func generate(fileName string, args Args) (string, error) { //nolint:gocognit,ma
162162 switch currType := currSpecType .Type .(type ) {
163163 case * ast.StructType :
164164 var fields []Field
165- needsOptions := false
166- needsOptionsIndex := false
167- fields , needsOptions , needsOptionsIndex = getFields (fields , currType , imports )
165+ fields , needsOptions , needsOptionsIndex := getFields (fields , currType , imports )
168166 for _ , f := range fields {
169167 if strings .HasPrefix (f .Type , "*" ) && (f .HasEqualOpt || f .HasEqual ) {
170168 needsOptions = true
@@ -271,7 +269,9 @@ func generate(fileName string, args Args) (string, error) { //nolint:gocognit,ma
271269 return packageName , nil
272270}
273271
274- func getFields (fields []Field , node * ast.StructType , imports map [string ]string ) (fieldsResult []Field , needsOptions , needsOptionsIndex bool ) { //nolint:gocognit
272+ func getFields (fields []Field , node * ast.StructType , imports map [string ]string ) ([]Field , bool , bool ) { //nolint:gocognit
273+ var needsOptions bool
274+ var needsOptionsIndex bool
275275 for _ , field := range node .Fields .List {
276276 if len (field .Names ) > 0 {
277277 res := getTypeString (field .Type , imports )
0 commit comments