tpl: After now accepts 0 as index
authorBaibhav Vatsa <baibhavvatsa@gmail.com>
Fri, 11 Oct 2019 01:16:15 +0000 (20:16 -0500)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 11 Oct 2019 06:35:27 +0000 (08:35 +0200)
commit096a4b67b98259dabff5ebfbfd879a41999a1ed2
treed940a0429e0983bd5c462b8841ca292b87886c2a
parentbc70f2bf123d94fc3226754ec9f1f44748e98162
tpl: After now accepts 0 as index

Modified the if conditional because of which after threw an error if called with 0 as index. The function now returns the whole original slice if 0 is passed as an index. Also added tests to test the new behavior.

Fixes #6388
tpl/collections/collections.go
tpl/collections/collections_test.go