Hacker News new | past | comments | ask | show | jobs | submit login

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



Especially useful if, for example, you'll be doing additional js templating that also use the mustache tag eg with Vuejs (can also be changed)


You'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




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: