resource: Resources.ByType should return Resources

Currently it returns []Resource.

This way the invocations can be nested.

Fixes #4234
This commit is contained in:
Bjørn Erik Pedersen 2018-01-07 10:53:45 +01:00
parent 8969331f5b
commit 97c1866e32
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -55,8 +55,8 @@ type Resource interface {
// I.e. both pages and images etc.
type Resources []Resource
func (r Resources) ByType(tp string) []Resource {
var filtered []Resource
func (r Resources) ByType(tp string) Resources {
var filtered Resources
for _, resource := range r {
if resource.ResourceType() == tp {