summaryrefslogtreecommitdiffstats
path: root/tpl/collections/apply.go
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/collections/apply.go')
-rw-r--r--tpl/collections/apply.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/tpl/collections/apply.go b/tpl/collections/apply.go
index d715aeb00..d41a3b1da 100644
--- a/tpl/collections/apply.go
+++ b/tpl/collections/apply.go
@@ -106,17 +106,8 @@ func applyFnToThis(fn, this reflect.Value, args ...interface{}) (reflect.Value,
func (ns *Namespace) lookupFunc(fname string) (reflect.Value, bool) {
if !strings.ContainsRune(fname, '.') {
- templ, ok := ns.deps.Tmpl.(tpl.TemplateFuncsGetter)
- if !ok {
- panic("Needs a tpl.TemplateFuncsGetter")
- }
- fm := templ.GetFuncs()
- fn, found := fm[fname]
- if !found {
- return reflect.Value{}, false
- }
-
- return reflect.ValueOf(fn), true
+ templ := ns.deps.Tmpl.(tpl.TemplateFuncGetter)
+ return templ.GetFunc(fname)
}
ss := strings.SplitN(fname, ".", 2)