hugo/tpl/collections
Baibhav Vatsa 0e75af74db tpl: Last now accepts 0 as limit
Modified the if conditional because of which last threw an error if 0 was passed as limit. The function now returns an empty slice if it is called with 0 as limit. The behavior of first and last is now the same when 0 is passed as limit. Also added tests to test the new behavior.

Fixes #6419
2019-10-11 20:34:51 +02:00
..
append.go common/maps: Improve append in Scratch 2018-10-08 12:30:50 +02:00
append_test.go tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
apply.go common/maps: Improve append in Scratch 2018-10-08 12:30:50 +02:00
apply_test.go tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
collections.go tpl: Last now accepts 0 as limit 2019-10-11 20:34:51 +02:00
collections_test.go tpl: Last now accepts 0 as limit 2019-10-11 20:34:51 +02:00
complement.go tpl/collections: Add collections.SymDiff 2018-11-06 16:51:49 +01:00
complement_test.go tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
index.go tpl: Add template function namespaces 2017-04-30 10:56:38 +02:00
index_test.go tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
init.go tpl/collections: Add Merge function 2019-07-15 20:47:35 +02:00
init_test.go tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
merge.go tpl/collections: Add Merge function 2019-07-15 20:47:35 +02:00
merge_test.go tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
reflect_helpers.go all: Apply staticcheck recommendations 2019-03-24 16:14:51 +01:00
sort.go Merge pull request #6149 from bep/sort-caseinsensitive 2019-08-01 10:19:19 +02:00
sort_test.go Merge pull request #6149 from bep/sort-caseinsensitive 2019-08-01 10:19:19 +02:00
symdiff.go tpl/collections: Add collections.SymDiff 2018-11-06 16:51:49 +01:00
symdiff_test.go tests: Convert from testify to quicktest 2019-08-12 13:26:32 +02:00
where.go tpl/collections: Unwrap any interface value in sort and where 2019-06-09 16:54:36 +02:00
where_test.go tpl/collections: Unwrap any interface value in sort and where 2019-06-09 16:54:36 +02:00