Fixed merge new array

This commit is contained in:
Mike Farah 2020-01-06 10:12:38 +13:00
parent 690da9ee74
commit e3f4eedd51

View File

@ -239,10 +239,6 @@ func (n *navigator) recurseArray(value *yaml.Node, head string, tail []string, p
value.Content = append(value.Content, &yaml.Node{Kind: guessKind(head, tail, 0)}) value.Content = append(value.Content, &yaml.Node{Kind: guessKind(head, tail, 0)})
} }
if index >= int64(len(value.Content)) {
log.Debug("index longer than array length, aborting!")
return nil
}
value.Content[index] = n.getOrReplace(value.Content[index], guessKind(head, tail, value.Content[index].Kind)) value.Content[index] = n.getOrReplace(value.Content[index], guessKind(head, tail, value.Content[index].Kind))
return n.doTraverse(value.Content[index], head, tail, append(pathStack, index)) return n.doTraverse(value.Content[index], head, tail, append(pathStack, index))