It would be great if the isTrue function in text.template were exposed (cf. https://golang.org/src/text/template/exec.go#L212). This would allow custom template functions to easily use the same semantics for truthiness that text.template itself uses for if.