]> Cypherpunks repositories - gostls13.git/commit
text/template: allow comparison functions to work between any integers
authorRob Pike <r@golang.org>
Mon, 22 Sep 2014 18:46:02 +0000 (11:46 -0700)
committerRob Pike <r@golang.org>
Mon, 22 Sep 2014 18:46:02 +0000 (11:46 -0700)
commitdb56d4d5eb14454e0d4b5c46d0dc89af11fbbf9d
tree8caafd19186e9f6a4833a43a236b4a796b8bc12b
parent5f739d9dcd01730e10d829968755c7b1a7b5f2b7
text/template: allow comparison functions to work between any integers
Previously, signed and unsigned integers could not be compared, but
this has problems with things like comparing 'x' with a byte in a string.
Since signed and unsigned integers have a well-defined ordering,
even though their types are different, and since we already allow
comparison regardless of the size of the integers, why not allow it
regardless of the sign?

Integers only, a fine place to draw the line.

Fixes #7489.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/149780043
src/text/template/doc.go
src/text/template/exec_test.go
src/text/template/funcs.go