Skip to content

text/template: Reconsider new IsTrue API #12801

@dsymonds

Description

@dsymonds

In https://go-review.googlesource.com/#/c/14593/, to address #12033, @robpike added a new function, func IsTrue(val reflect.Value) (truth, ok bool) to text/template. That's the first use of reflect in this package's API, thus pulling in ~16 KB of new package export data.

An alternative is to change this new function to be func IsTrue(val interface{}) (truth, ok bool), and do the reflection inside the text/template package.

After a brief discussion with @adg, he asked me to file an issue to track this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions