Skip to content

Commit

Permalink
fix?: copied case from function below
Browse files Browse the repository at this point in the history
  • Loading branch information
Duologic committed Jul 1, 2024
1 parent b3ee312 commit 1d117f1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/ast/processing/find_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,19 @@ func FindRangesFromIndexList(stack *nodestack.NodeStack, indexList []string, vm
if funcBody := findChildDesugaredObject(bodyNode.Body); funcBody != nil {
foundDesugaredObjects = append(foundDesugaredObjects, funcBody)
}
case *ast.Var:
varReference, err := FindVarReference(bodyNode, vm)
if err != nil {
return nil, err
}
// If the reference is an object, add it directly to the list of objects to look in
// Otherwise, add it back to the list for further processing
if varReferenceObj := findChildDesugaredObject(varReference); varReferenceObj != nil {
foundDesugaredObjects = append(foundDesugaredObjects, varReferenceObj)
}
//else {

Check failure on line 87 in pkg/ast/processing/find_field.go

View workflow job for this annotation

GitHub Actions / lint

commentFormatting: put a space between `//` and comment text (gocritic)
// fieldNodes = append(fieldNodes, varReference)
//}
default:
return nil, fmt.Errorf("unexpected node type when finding bind for '%s': %s", start, reflect.TypeOf(bind.Body))
}
Expand Down

0 comments on commit 1d117f1

Please sign in to comment.