You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.Timeis the zero of its type, so according to the documentation it should be considered to be true, but the implementation clearly intends otherwise:
If the decision was document or fix, document it. As @mvdan says, it's been that way for a long time. It's not worth a semantic change.
rsc
added
the
NeedsFix
The path to resolution is known, but the work has not been done.
label
Nov 14, 2018
gopherbot
removed
the
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
label
Nov 14, 2018
As noted in #28391, the documentation for
template.IsTrue
says: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:go/src/text/template/exec.go
Lines 326 to 327 in f6b554f
Either the documentation should be clarified, or the behavior of
IsTrue
should be fixed to match what is documented. Probably the former.The text was updated successfully, but these errors were encountered: