mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 17:36:59 +08:00
Fixed creation of candidateNode in operators to include file metadata
This commit is contained in:
@@ -13,7 +13,7 @@ func getDocumentIndexOperator(d *dataTreeNavigator, matchingNodes *list.List, pa
|
||||
for el := matchingNodes.Front(); el != nil; el = el.Next() {
|
||||
candidate := el.Value.(*CandidateNode)
|
||||
node := &yaml.Node{Kind: yaml.ScalarNode, Value: fmt.Sprintf("%v", candidate.Document), Tag: "!!int"}
|
||||
scalar := &CandidateNode{Node: node, Document: candidate.Document, Path: candidate.Path}
|
||||
scalar := candidate.CreateChild(nil, node)
|
||||
results.PushBack(scalar)
|
||||
}
|
||||
return results, nil
|
||||
|
||||
Reference in New Issue
Block a user