From: Bjørn Erik Pedersen Date: Sun, 7 Jan 2018 09:53:45 +0000 (+0100) Subject: resource: Resources.ByType should return Resources X-Git-Tag: v0.32.3~6 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=97c1866e322284dec46db6f3d235807507f5b69f;p=brevno-suite%2Fhugo resource: Resources.ByType should return Resources Currently it returns []Resource. This way the invocations can be nested. Fixes #4234 --- diff --git a/resource/resource.go b/resource/resource.go index 72ce2912..3c4007d8 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 {