Skip to content

Commit

Permalink
Update definition of falsy to include zero time.Time values
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored Aug 25, 2024
1 parent b0e5ab0 commit c3350f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/en/functions/go-template/_common/truthy-falsy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
# Do not remove front matter.
---

In Go templates, the falsy values are `false`, `0`, any nil pointer or interface value, and any array, slice, map, or string of length zero. Everything else is truthy.
The falsy values are `false`, `0`, any `nil` pointer or interface value, any array, slice, map, or string of length zero, and zero `time.Time` values.

Everything else is truthy.

0 comments on commit c3350f4

Please sign in to comment.