]> Cypherpunks.ru repositories - gostls13.git/commit
text/template: implement short-circuit and, or
authorRuss Cox <rsc@golang.org>
Thu, 20 May 2021 15:33:36 +0000 (11:33 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 21 Sep 2021 14:02:52 +0000 (14:02 +0000)
commit7d67f8d4354d864fcbe6b218b7f80bcdfde851c9
treec965e575b56e7a25b3c8053bee7b05954e3dcd85
parent39e08c6cd75da72059a58f05eb500b48124d563e
text/template: implement short-circuit and, or

Making the builtin and and or functions use short-circuit
evaluation was accepted as a proposal in April 2019,
but we never got around to implementing it. Do that.

Fixes #31103.

Change-Id: Ia43d4a9a6b0ab814f2dd3471ebaca3e7bb1505cf
Reviewed-on: https://go-review.googlesource.com/c/go/+/321490
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/doc.go
src/text/template/exec.go
src/text/template/exec_test.go
src/text/template/funcs.go