diff options
author | Bjørn Erik Pedersen <[email protected]> | 2018-09-09 10:15:11 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2018-09-10 09:19:01 +0200 |
commit | fe6676c775b8d917a661238f24fd4a9088f25d50 (patch) | |
tree | a84c05a70dc203392db4343a2185cfe0a5714140 /common | |
parent | 7a97d3e6bca1e30826e1662b5f299b66aa8ab385 (diff) | |
download | hugo-fe6676c775b8d917a661238f24fd4a9088f25d50.tar.gz hugo-fe6676c775b8d917a661238f24fd4a9088f25d50.zip |
tpl/collections: Improve type handling in collections.Slice
Fixes #5188
Diffstat (limited to 'common')
-rw-r--r-- | common/collections/collections.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/collections/collections.go b/common/collections/collections.go index bb47c8acc..854f705b3 100644 --- a/common/collections/collections.go +++ b/common/collections/collections.go @@ -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) +} |