RangeList iterates over the list and calls the provided function for each element. If the function returns false, the iteration will stop.
(node *yaml.Node, fn func(int, *yaml.Node) bool)
| 29 | // RangeList iterates over the list and calls the provided function for each element. If the |
| 30 | // function returns false, the iteration will stop. |
| 31 | func (yc YAMLHelper) RangeList(node *yaml.Node, fn func(int, *yaml.Node) bool) { |
| 32 | if !yc.IsList(node) { |
| 33 | return |
| 34 | } |
| 35 | for i, val := range node.Content { |
| 36 | if !fn(i, val) { |
| 37 | break |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // IsMap returns true if the YAML node is a map. |
| 43 | func (YAMLHelper) IsMap(node *yaml.Node) bool { |