Fixed creation of candidateNode in operators to include file metadata

This commit is contained in:
Mike Farah
2021-02-11 10:58:40 +11:00
parent 49ac2bac13
commit 7518dac99c
19 changed files with 72 additions and 107 deletions
+2 -2
View File
@@ -84,8 +84,8 @@ func getCommentsOperator(d *dataTreeNavigator, matchingNodes *list.List, pathNod
comment = strings.Replace(comment, "# ", "", 1)
node := &yaml.Node{Kind: yaml.ScalarNode, Value: comment, Tag: "!!str"}
lengthCand := &CandidateNode{Node: node, Document: candidate.Document, Path: candidate.Path}
results.PushBack(lengthCand)
result := candidate.CreateChild(nil, node)
results.PushBack(result)
}
return results, nil
}