diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-07 10:53:45 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-07 10:53:45 +0100 |
commit | 97c1866e322284dec46db6f3d235807507f5b69f (patch) | |
tree | 889fcb9f1aea985ffd6e75b6efec1c0ceebfb8a8 /resource/resource.go | |
parent | 8969331f5be352939883074034adac6b7086ddc8 (diff) |
resource: Resources.ByType should return Resources
Currently it returns []Resource.
This way the invocations can be nested.
Fixes #4234
Diffstat (limited to 'resource/resource.go')
-rw-r--r-- | resource/resource.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/resource/resource.go b/resource/resource.go index 72ce29125..3c4007d81 100644 --- a/resource/resource.go +++ b/resource/resource.go @@ -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 { |