hcl/ast/visitor_mock.go
Mitchell Hashimoto 358b43ddbc JSON parser
2014-08-02 11:38:41 -07:00

12 lines
249 B
Go

package ast
// MockVisitor is a visitor implementation that can be used for tests
// and simply records the nodes that it has visited.
type MockVisitor struct {
Nodes []Node
}
func (v *MockVisitor) Visit(n Node) {
v.Nodes = append(v.Nodes, n)
}