]> Cypherpunks repositories - gostls13.git/commit
text/template: implement comparison of basic types
authorRob Pike <r@golang.org>
Wed, 21 Aug 2013 01:27:27 +0000 (11:27 +1000)
committerRob Pike <r@golang.org>
Wed, 21 Aug 2013 01:27:27 +0000 (11:27 +1000)
commit7bbe32067922643a30ac7adf8aa3da9785d89d13
tree37e0d79e7f8e1c5b81c4148af758aa52d8cdb4c2
parentb3424a78503dffde52dcd6bf830ed63ee316defa
text/template: implement comparison of basic types

Add eq, lt, etc. to allow one to do simple comparisons.
It's basic types only (booleans, integers, unsigned integers,
floats, complex, string) because that's easy, easy to define,
and covers the great majority of useful cases, while leaving
open the possibility of a more sweeping definition later.

{{if eq .X .Y}}X and Y are equal{{else}}X and Y are unequal{{end}}

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/13091045
src/pkg/text/template/doc.go
src/pkg/text/template/exec_test.go
src/pkg/text/template/funcs.go