mirror of
https://github.com/golang/go
synced 2024-11-25 23:17:58 -07:00
cc842c738e
Based on work by Russ Cox. From his CL: This is generally useful but especially helpful when trying to use the built-in boolean operators. It lets you write: {{if not (f 1)}} foo {{end}} {{if and (f 1) (g 2)}} bar {{end}} {{if or (f 1) (g 2)}} quux {{end}} instead of {{if f 1 | not}} foo {{end}} {{if f 1}}{{if g 2}} bar {{end}}{{end}} {{$do := 0}}{{if f 1}}{{$do := 1}}{{else if g 2}}{{$do := 1}}{{end}}{{if $do}} quux {{end}} The result can be a bit LISPy but the benefit in expressiveness and readability for such a small change justifies it. I believe no changes are required to html/template. Fixes #3276. R=golang-dev, adg, rogpeppe, minux.ma CC=golang-dev https://golang.org/cl/6482056 |
||
---|---|---|
.. | ||
cmd | ||
lib9 | ||
libbio | ||
libmach | ||
pkg | ||
all.bash | ||
all.bat | ||
all.rc | ||
clean.bash | ||
clean.bat | ||
clean.rc | ||
make.bash | ||
make.bat | ||
Make.dist | ||
make.rc | ||
run.bash | ||
run.bat | ||
run.rc | ||
sudo.bash |