and
语法
and VALUE...
返回
any
虚值包括 false
、0
、任何 nil
指针或接口值、任何长度为零的数组、切片、映射或字符串,以及零值的 time.Time
值。
其他所有值均为真值。
{{ and 1 0 "" }} → 0 (int)
{{ and 1 false 0 }} → false (bool)
{{ and 1 2 3 }} → 3 (int)
{{ and "a" "b" "c" }} → c (string)
{{ and "a" 1 true }} → true (bool)
有关更多信息,请参阅 Go 的 text/template 文档。