]> Cypherpunks repositories - gostls13.git/commit
text/template: add "else with" action
authorrogeryk <rogeryk@outlook.com>
Tue, 28 Nov 2023 12:41:03 +0000 (20:41 +0800)
committerGopher Robot <gobot@golang.org>
Sat, 24 Feb 2024 21:59:12 +0000 (21:59 +0000)
commit08d9397170e5870b72a95233e8e4ec43d2d70e30
tree766a6afaf628dcaa79587eb6d0f7074eeebc7e9b
parente0fc269f77af97f7cf33097d82f92ff7e08a2f06
text/template: add "else with" action

Add "else with" action will reduce the template complexity in some use cases(#57646).
This action will be added:
  {{with pipeline}} T1 {{else with pipeline}} T0 {{end}}.

Fixes #57646

Change-Id: I90ed546ab671805f753343b00bd3c9d1a1d5581d
Reviewed-on: https://go-review.googlesource.com/c/go/+/545376
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/html/template/exec_test.go
src/text/template/doc.go
src/text/template/exec_test.go
src/text/template/parse/parse.go
src/text/template/parse/parse_test.go