mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-26 00:15:36 +00:00
Fixed delete splat
This commit is contained in:
parent
8be006fba4
commit
2344638da4
@ -89,7 +89,8 @@ func (n *navigator) Delete(rootNode *yaml.Node, path []string) error {
|
|||||||
nodeToUpdate.Content = append(original[:index], original[index+1:]...)
|
nodeToUpdate.Content = append(original[:index], original[index+1:]...)
|
||||||
|
|
||||||
} else if nodeToUpdate.Kind == yaml.MappingNode {
|
} else if nodeToUpdate.Kind == yaml.MappingNode {
|
||||||
// need to delete in reverse...
|
// need to delete in reverse - otherwise the matching indexes
|
||||||
|
// become incorrect.
|
||||||
matchingIndices := make([]int, 0)
|
matchingIndices := make([]int, 0)
|
||||||
_, errorVisiting := n.visitMatchingEntries(nodeToUpdate.Content, lastBit, func(indexInMap int) error {
|
_, errorVisiting := n.visitMatchingEntries(nodeToUpdate.Content, lastBit, func(indexInMap int) error {
|
||||||
matchingIndices = append(matchingIndices, indexInMap)
|
matchingIndices = append(matchingIndices, indexInMap)
|
||||||
|
Loading…
Reference in New Issue
Block a user