template

81 views
Skip to first unread message

Tharaneedharan Vilwanathan

unread,
Jul 21, 2020, 5:00:31 PM7/21/20
to golang-nuts
Hi All,

I am running a website for which we use templates.

While I see the benefit of templates, I also notice that it has gotten ugly over time.

So, here are my questions:

- Are templates popular? Or do you avoid using it?
- Any do's and don'ts? Any best practices?
- Any suggestions on formatting of templates?

Regards
dharani

Lutz Horn

unread,
Jul 22, 2020, 2:54:57 PM7/22/20
to golan...@googlegroups.com
> I am running a website for which we use templates.

Do you use https://golang.org/pkg/html/template/? If yes, how do you use
them? If no, this question is off-topic for this mailing list.

Lutz

Tharaneedharan Vilwanathan

unread,
Jul 23, 2020, 5:57:25 AM7/23/20
to Lutz Horn, golang-nuts
Hi Lutz,

Sorry I was not clear earlier. Yes, this is regarding Go HTML template.

We use beego and HTML templates under that.

We generally use nested templates in which we have nested if conditions as needed and for loop (range). We also do some minor computation, etc.

I feel over time, the template file has gone out of shape and became difficult to understand and maintain. Hence my questions.

Hope this helps. Please let me know if you have any questions.

Regards
dharani


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/AM7P191MB1060A58CEA463342E216714B9E790%40AM7P191MB1060.EURP191.PROD.OUTLOOK.COM.
Reply all
Reply to author
Forward
0 new messages