VisitAll is a basic way to traverse the AST beginning with a particular node. The given function will be called once for each AST node in depth-first order, but no context is provided about the shape of the tree. The VisitFunc may return diagnostics, in which case they will be accumulated and retur
(node Node, f VisitFunc)
| 17 | // The VisitFunc may return diagnostics, in which case they will be accumulated |
| 18 | // and returned as a single set. |
| 19 | func VisitAll(node Node, f VisitFunc) hcl.Diagnostics { |
| 20 | diags := f(node) |
| 21 | node.walkChildNodes(func(node Node) { |
| 22 | diags = append(diags, VisitAll(node, f)...) |
| 23 | }) |
| 24 | return diags |
| 25 | } |
| 26 | |
| 27 | // Walker is an interface used with Walk. |
| 28 | type Walker interface { |
nothing calls this directly
no test coverage detected