You can use 'with' to achieve what you want. Take a look at this example
https://play.golang.org/p/incDGEmUJK I have to say your question is not clear and i just guessed what you want. Thanks. Josh On Wed, Nov 8, 2017 at 12:03 PM, <mkaur25...@gmail.com> wrote: > Hi everyone, > > I am trying to create email templates having html tokens in golang. I have > searched all over the web and found > > "html/template" > > library. It supports token format like below > > Hello {{.Name}} > <a href="{{.URL}}">Confirm email address</a> > > But the requirement for html token is something like > Name: {{ test.name }} > Phone: {{ test.phone }} > Address: {{ test.address }}, {{ test.city }}, {{ test.state }} {{ test.zip > }} > > I could not found such token system in golang or any library supporting > such format. Can anyone please tell how can I achieve to create such > tokens. There should be no dot before the attribue. either it should be > only the attribute like {{Name}} or like {{ test.name }}. > > Thank you! > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.