(root ast.Node)
| 8 | ) |
| 9 | |
| 10 | func findParameters(root ast.Node) ([]paramRef, []error) { |
| 11 | refs := make([]paramRef, 0) |
| 12 | errors := make([]error, 0) |
| 13 | v := paramSearch{seen: make(map[int]struct{}), refs: &refs, errs: &errors} |
| 14 | astutils.Walk(v, root) |
| 15 | if len(*v.errs) > 0 { |
| 16 | return refs, *v.errs |
| 17 | } else { |
| 18 | return refs, nil |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | type paramRef struct { |
| 23 | parent ast.Node |