Skip to content

text/template: Better doc for ParseFiles and Execute behaviour. #11247

@siritinga

Description

@siritinga

Hello.

I recently spent some time trying to figure why a template with Funcmaps would work with Parse() but not with ParseFiles() when using Execute (instead of ExecuteTemplate with the name).

I found the answer in Stack Overflow http://stackoverflow.com/questions/10199219/go-template-function but the question also appeared in golang-nuts, for example here https://groups.google.com/forum/#!topic/golang-nuts/CI9WdC_sk00 and here https://groups.google.com/forum/#!topic/golang-nuts/vmZHHfLsH8M

Please consider if it should be better documented to make it less error-prone for inexperienced users.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions