Return path, smart print

This commit is contained in:
Mike Farah
2019-12-22 17:13:11 +11:00
parent 784513dd18
commit 4fb44dbc47
3 changed files with 68 additions and 72 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ type UpdateCommand struct {
type YqLib interface {
DebugNode(node *yaml.Node)
Get(rootNode *yaml.Node, path string) (*yaml.Node, error)
Get(rootNode *yaml.Node, path string) ([]MatchingNode, error)
Update(rootNode *yaml.Node, updateCommand UpdateCommand) error
New(path string) yaml.Node
}
@@ -38,7 +38,7 @@ func (l *lib) DebugNode(node *yaml.Node) {
navigator.DebugNode(node)
}
func (l *lib) Get(rootNode *yaml.Node, path string) (*yaml.Node, error) {
func (l *lib) Get(rootNode *yaml.Node, path string) ([]MatchingNode, error) {
var paths = l.parser.ParsePath(path)
navigator := NewDataNavigator(l.log, true)
return navigator.Get(rootNode, paths)