mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	tpl/collections: Improve type handling in collections.Slice
Fixes #5188
This commit is contained in:
		@@ -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)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user