goods/tmpl — Issue #9: Calling on func values from selectors
Author: zeebo
Created: 2012-03-05 19:18:31+00:00
State: open

We should be able to call methods or function types from selectors. For example, given

type foo struct {
bar string
baz string
}

func (f foo) foo(s string) interface{} {
return s
}

and we execute a template with the context as a value of type foo, we should be able to do

{% .bar %}
{% call .foo .bar %}

or if we had a context of value

map[string]interface{}{
"foo": func(s string) interface{} {
return s
},
"bar": "bar",
}

we should be able to do the same template as before.