From 3f30213e4c4905711afccf9916cfed6d04c68f5f Mon Sep 17 00:00:00 2001 From: JT Olds Date: Tue, 30 May 2017 02:42:42 -0600 Subject: [PATCH] update whtmpl collection funcs --- whtmpl/tmpl.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/whtmpl/tmpl.go b/whtmpl/tmpl.go index d5053db..00363e8 100644 --- a/whtmpl/tmpl.go +++ b/whtmpl/tmpl.go @@ -105,9 +105,11 @@ func makemap(vals ...interface{}) map[interface{}]interface{} { return rv } -// Allows you to add and overwrite template function definitions. -func (tc *Collection) Funcs(m template.FuncMap) { +// Allows you to add and overwrite template function definitions. Mutates +// called collection and returns self. +func (tc *Collection) Funcs(m template.FuncMap) *Collection { tc.group = tc.group.Funcs(m) + return tc } // MustParse parses template source "tmpl" and stores it in the