This commit is contained in:
Mike Farah
2020-11-06 14:37:01 +11:00
parent b290a65602
commit 2edf64182b
9 changed files with 129 additions and 89 deletions
+9
View File
@@ -43,6 +43,15 @@ func (p *resultsPrinter) writeString(writer io.Writer, txt string) error {
}
func (p *resultsPrinter) PrintResults(matchingNodes *list.List, writer io.Writer) error {
var err error
if p.outputToJSON {
explodeOp := Operation{OperationType: Explode}
explodeNode := PathTreeNode{Operation: &explodeOp}
matchingNodes, err = treeNavigator.GetMatchingNodes(matchingNodes, &explodeNode)
if err != nil {
return err
}
}
bufferedWriter := bufio.NewWriter(writer)
defer safelyFlush(bufferedWriter)