sprig
sprig copied to clipboard
List join functions (append / prepend but for multiple lists)
Issue-fied version of https://github.com/Masterminds/sprig/issues/3#issuecomment-349094450:
Since append is not variadic, is there a method to concatenate two arrays/slices? This would be nice:
{{ range (append .arrayA .arrayB) }}
Specifically, this feature request is to add two new (variadic, as per #3) functions:
$newList = appendlist $myList $otherList $yetAnotherList$newList = prependlist $myList $otherList $yetAnotherList
Since join is taken, if appendlist / prependlist are deemed too long & unwieldy, I alternatively propose to name them cat and tac in recognition of eponymous POSIX command-line tools.
concat has already been added to combine lists.
prepending would be a feature request.