-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Open
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.NeedsFixThe 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
As noted in #28391, the documentation for template.IsTrue says:
IsTrue reports whether the value is 'true', in the sense of not the zero of its type, and whether the value has a meaningful truth value.
The zero time.Time is the zero of its type, so according to the documentation it should be considered to be true, but the implementation clearly intends otherwise:
Lines 326 to 327 in f6b554f
| case reflect.Struct: | |
| truth = true // Struct values are always true. |
Either the documentation should be clarified, or the behavior of IsTrue should be fixed to match what is documented. Probably the former.
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.NeedsFixThe 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.