Fixed newline handling when decoding/encoding

This commit is contained in:
Mike Farah
2021-10-22 14:53:39 +11:00
parent 7288d34778
commit b1e64a0d80
4 changed files with 67 additions and 7 deletions
+7
View File
@@ -1,6 +1,7 @@
package yqlib
import (
"container/list"
"fmt"
"github.com/jinzhu/copier"
@@ -28,6 +29,12 @@ func (n *CandidateNode) GetKey() string {
return fmt.Sprintf("%v%v - %v", keyPrefix, n.Document, n.Path)
}
func (n *CandidateNode) AsList() *list.List {
elMap := list.New()
elMap.PushBack(n)
return elMap
}
func (n *CandidateNode) CreateChild(path interface{}, node *yaml.Node) *CandidateNode {
return &CandidateNode{
Node: node,