ChildNodes returns an iterator over children of type *Node.
()
| 25 | |
| 26 | // ChildNodes returns an iterator over children of type *Node. |
| 27 | func (n *Node) ChildNodes() iter.Seq[*Node] { |
| 28 | return func(yield func(*Node) bool) { |
| 29 | for _, child := range n.Children { |
| 30 | cn, ok := child.(*Node) |
| 31 | if !ok { |
| 32 | continue |
| 33 | } |
| 34 | if !yield(cn) { |
| 35 | return |
| 36 | } |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | // FilterChildNodes removes all child nodes of type *Node |
| 42 | // that do not satisfy the given predicate function. |
nothing calls this directly
no outgoing calls
no test coverage detected