summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-01-07 10:53:45 +0100
committerBjørn Erik Pedersen <[email protected]>2018-01-07 10:53:45 +0100
commit97c1866e322284dec46db6f3d235807507f5b69f (patch)
tree889fcb9f1aea985ffd6e75b6efec1c0ceebfb8a8
parent8969331f5be352939883074034adac6b7086ddc8 (diff)
downloadhugo-97c1866e322284dec46db6f3d235807507f5b69f.tar.gz
hugo-97c1866e322284dec46db6f3d235807507f5b69f.zip
resource: Resources.ByType should return Resources
Currently it returns []Resource. This way the invocations can be nested. Fixes #4234
-rw-r--r--resource/resource.go4
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 {