Skip to content

text/template: func fields should be invokable #3025

@dsymonds

Description

@dsymonds
If I have a data type such as
  type fooer struct {
    F func() string
  }

then this template should work:
  {{.F}}

However, I get this error instead:
  couldn't execute template: template: foo:1: can't print {{.F}} of type func() string

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