-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
Go 1.6+
What operating system and processor architecture are you using (go env)?
Any
What did you do?
https://play.golang.org/p/SeHjhOvCFZ (html/template)
https://play.golang.org/p/EeVfv5_IcQ (text/template)
What did you expect to see?
I would expect that both success() and fail() successfully write the string "foo" to stdout
What did you see instead?
The fail function panics with the error, panic: template: :1: function "foo" not defined. If possible, it would feel much more consistent for both of these functions to succeed. If that is not possible, updating the documentation to reflect the need for custom functions to be defined before the template is loaded would be very helpful to confused users.
See, for example:
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.