mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-02 22:52:51 +02:00
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
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
bc70f2bf12
commit
096a4b67b9
@@ -60,7 +60,7 @@ func (ns *Namespace) After(index interface{}, seq interface{}) (interface{}, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if indexv < 1 {
|
||||
if indexv < 0 {
|
||||
return nil, errors.New("can't return negative/empty count of items from sequence")
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user