Skip to content

Calling on func values from selectors #9

@zeebo

Description

@zeebo

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions