or
Syntax
or VALUE...
Returns
any
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.
{{ or 0 1 2 }} → 1
{{ or false "a" 1 }} → a
{{ or 0 true "a" }} → true
{{ or false "" 0 }} → 0
{{ or 0 "" false }} → false
See Go’s text/template documentation for more information.