Function
find
(doc *yaml.Node, predicate func(*yaml.Node) bool)
Source from the content-addressed store, hash-verified
| 125 | } |
| 126 | |
| 127 | func find(doc *yaml.Node, predicate func(*yaml.Node) bool) *yaml.Node { |
| 128 | if predicate(doc) { |
| 129 | return doc |
| 130 | } |
| 131 | |
| 132 | for _, content := range doc.Content { |
| 133 | if found := find(content, predicate); found != nil { |
| 134 | return found |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | return nil |
| 139 | } |
| 140 | |
| 141 | func containsChild(child *yaml.Node) func(*yaml.Node) bool { |
| 142 | return func(node *yaml.Node) bool { |
Tested by
no test coverage detected