3 ms·
I am not a Go developer, but given the prevalence of Go in infrastructure tools I've written Go templates. My understanding of Go's built-in templating is that
by danpalmer 5y ago
I am not a Go developer, but given the prevalence of Go in infrastructure tools I've written Go templates.
My understanding of Go's built-in templating is that it is the bare-minimum templating language worth including with the language. Useful for quick and dirty plain HTML pages for inspecting service states, not for building frontends.
Does this package really intend to use Go templates for your whole frontend? That seems not ideal?
- guessmyname 5y ago> Does this package really intend to use Go templates for your whole frontend? That seems not ideal? Yes, based on this page [1] it looks like that is the intension. I built a user account manager from scratch for a company with 56M users, and utilized Go templates for all the static content and pages that only needed a handful of variables. For more complex pages, Go templates was very cumbersome, so I had to add a JavaScript framework (Vue.js) to implement pages that users were supposed to interact with. I enjoy using Go for command line tools, system background services, and web services, but for complex web development, never again. After three (3) years working on that project, I would not recommend Go templates for complex web development at all. [1] https://kyoto.codes/docs/core-features.html#component-lifecycle https://kyoto.codes/docs/core-features.html#component-lifecy...
- jamesrr39 5y agoI worked on a project using Revel, which uses Go templates. As the pages got more complex, we ran into the same problem. Eventually (most of) that app got replaced by a Go server and React front end. My takeaway was that it seems to me like Go templates work well for simpler stuff; displaying simple content, debug info, etc. But as soon as you want to edit something you should start thinking about moving to a more appropriate stack.
- jagger27 5y agoGo templates are a nice balance of power and simplicity in my experience (Hugo, and a few similar projects). What features do you miss from other templating engines?
- majewsky 5y agoThey may refer to the definitive shortage of built-in functions. The template engine itself only provides the bare minimum. That's usually not a problem because of template function libraries like https://github.com/Masterminds/sprig https://github.com/Masterminds/sprig