How do I escape “{{” and “}}” delimiters in Go templates?
{{"{{"}}
{{"}}"}}
produces
{{
}}
A simple workaround would be using
{{`{{Your.Angular.Data}}`}}
I don't know how to escape it, but you could choose a different delimiter instead using Delims
:
func (t *Template) Delims(left, right string) *Template
According to the mailing list, this is probably the best option. The argument was that if you escape it, your templates will be hard to read, so it would probably be better anyway to change the delimiter instead of trying to hack around it.