-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Milestone
Description
What version of Go are you using (go version)?
1.16.4
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOOS="darwin"
What did you do?
The desire is to be able to place multiple commands in a Go text template. We already have newlines supported ( #29770 ). If we get multiple commands using any separator, we can simplify templates with multiple mustaches one after the other.
An example using Hugo (with a semi-colon as a separator, can be anything):
{{
with site.Title;
printf "%s" (. | humanize);
else;
printf "No title";
end;
}}
equivalent to:
{{with site.Title}}
{{printf "%s" (. | humanize)}}
{{else}}
{{printf "No title"}}
{{end}}
davidovich, l-zeuch and emetkoearthboundkid and darless