DEV Community

Cover image for Understanding Go Templates
Donald Feury
Donald Feury

Posted on β€’ Edited on β€’ Originally published at donaldfeury.xyz

1 2

Understanding Go Templates

Code can be found here

Go actually has a template package in its standard library, which is pretty sweet. Normally, this is something you see in separate 3rd party libraries or included in full frameworks, such as Laravel or Rails.

Its very powerful too. In addition to injecting your data into templates, you can extend what you can do while processing the data passed into a template by passing in a map of functions.

I once used it to generate the approx. 150 data types that were listed in Mixer's API documentation. That saved me tons of time from writing boilerplate code.

Check it out and let me know what ya'll think. Any feedback is greatly appreciated.

If you liked it and want to know when I post more, be sure to subscribe and thank ya'll again for your time!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post