Correct error check for child walk

This was checking another error not childErr -- which would skip child errors and cause issues. I haven't seen this in practice but found while debugging another issue.
This commit is contained in:
Thomas Jackson 2023-03-30 08:11:48 -07:00 committed by Rishabh Kumar
parent a95115a6da
commit f77a0e5aba

View file

@ -357,7 +357,7 @@ func Walk(ctx context.Context, v Visitor, s *EvalStmt, node Node, path []Node, n
wg.Add(1)
go func(i int, e Node) {
defer wg.Done()
if childNode, childErr := Walk(ctx, v, s, e, append([]Node{}, path...), nr); err != nil {
if childNode, childErr := Walk(ctx, v, s, e, append([]Node{}, path...), nr); childErr != nil {
errs[i] = childErr
} else {
newChildren[i] = childNode