4 ms·
An additional tip. Template actions don't necessarily have to be delimited by '{{' and '}}'. Before parsing, you can call Delims to use custom delimiters. f
by nishs 9y ago
An additional tip. Template actions don't necessarily have to be delimited by '{{' and '}}'.
Before parsing, you can call Delims to use custom delimiters.
func (t *Template) Delims(left, right string) *Template
https://golang.org/pkg/text/template/#Template.Delims https://golang.org/pkg/text/template/#Template.Delims
- mdaniel 9y agoYou've given me a fantastic Christmas present! Now I just have to lobby the projects which use the defaults to make the delims configurable, saving their users keystrokes and horrible "how do I escape golang template delims" anxiety
- _Chief 9y agoEspecially useful if, for example, you'll be doing additional js templating that also use the mustache tag eg with Vuejs (can also be changed)