Skip to content

Commit 4abdca1

Browse files
committed
Fix child reassignment after Map
This fixes a bug that was introduced in e6ce13f where the newChild was checked and added to the child list but was not walked after being mapped. This resulted in invalid handling of the child, since the walk would then proceed incorrectly with the original child instead of its replacement. This in particular breaks things like include mappings that replace a statement with a document (or collection of documents).
1 parent ce8e982 commit 4abdca1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

walk.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ func walkInContext(context, parent ParentNode, walker Walker) (err error) {
8282
i--
8383
continue
8484
}
85-
children[i] = newChild
85+
86+
child = newChild
87+
children[i] = child
8688
}
8789

8890
switch child := child.(type) {

0 commit comments

Comments
 (0)