]> Cypherpunks.ru repositories - gostls13.git/commit
text/template: fix type bug in eq
authorRuss Cox <rsc@golang.org>
Thu, 6 May 2021 01:13:24 +0000 (21:13 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 6 May 2021 13:39:39 +0000 (13:39 +0000)
commitd2fd503f687ca686cb8fbee0b29e64ba529038fe
tree71e62367ff1a6b5af78e6c2985f87e650d79aa7d
parent0e7a7a68cd2a29895eae345ce56145b780d4a06c
text/template: fix type bug in eq

{{eq .x 0}} where .x is a nil interface{} should be false, not a type error.

Similarly, {{eq .x .x}} should succeed, not panic in reflect.

Fixes #45982.

Change-Id: I90aba82bb2f1a9e162bde1290c94f5028f56f412
Reviewed-on: https://go-review.googlesource.com/c/go/+/317470
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
src/text/template/exec_test.go
src/text/template/funcs.go