tpl/collections: Improve type handling in collections.Slice

Fixes #5188
This commit is contained in:
Bjørn Erik Pedersen
2018-09-09 10:15:11 +02:00
parent 7a97d3e6bc
commit fe6676c775
10 changed files with 275 additions and 68 deletions

View File

@@ -19,3 +19,10 @@ package collections
type Grouper interface {
Group(key interface{}, items interface{}) (interface{}, error)
}
// Slicer definse a very generic way to create a typed slice. This is used
// in collections.Slice template func to get types such as Pages, PageGroups etc.
// instead of the less useful []interface{}.
type Slicer interface {
Slice(items []interface{}) (interface{}, error)
}