1
0
mirror of https://github.com/TomWright/dasel.git synced 2022-05-22 02:32:45 +03:00

Simplify NewFromFile

This commit is contained in:
beatcracker
2021-12-08 19:17:58 +03:00
parent 7e10ac11f7
commit 0a2b0418b6

16
node.go
View File

@@ -142,21 +142,7 @@ func NewFromFile(path, parser string) (*Node, error) {
return nil, err
}
rootNode := &Node{
Previous: nil,
Next: nil,
NextMultiple: nil,
Selector: Selector{
Raw: ".",
Current: ".",
Remaining: "",
Type: "ROOT",
Property: "",
},
}
rootNode.setRealValue(data)
return rootNode, nil
return New(data), nil
}
func (n *Node) setValue(newValue interface{}) {