loading...
Cover image for Go's Template Package is Pretty Powerful

Go's Template Package is Pretty Powerful

dak425 profile image Donald Feury Updated on ・1 min read

Go Tutorials (13 Part Series)

1) Looking for feedback on Golang Crash Course Video 2) My second programming tutorial - Go Concurrency Crash Course 3 ... 11 3) Did you know you can create a REST API in Go using only the standard packages? 4) All about interfaces in Go 5) Go Modules - Dependency Management Made Easy 6) Lets splash a little MySQL with our Go 7) Go's Template Package is Pretty Powerful 8) Go has no exceptions, no try catch, only ERROR. 9) Error Chains in Go 1.13 10) Channel your inner snek 🐍 to configure your Go programs 11) Take command of your go programs with Cobra 🐍 12) Lets go on a ride with logs in Go 13) Lets do some magic tricks with Go Slices

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!

Go Tutorials (13 Part Series)

1) Looking for feedback on Golang Crash Course Video 2) My second programming tutorial - Go Concurrency Crash Course 3 ... 11 3) Did you know you can create a REST API in Go using only the standard packages? 4) All about interfaces in Go 5) Go Modules - Dependency Management Made Easy 6) Lets splash a little MySQL with our Go 7) Go's Template Package is Pretty Powerful 8) Go has no exceptions, no try catch, only ERROR. 9) Error Chains in Go 1.13 10) Channel your inner snek 🐍 to configure your Go programs 11) Take command of your go programs with Cobra 🐍 12) Lets go on a ride with logs in Go 13) Lets do some magic tricks with Go Slices

Posted on by:

dak425 profile

Donald Feury

@dak425

Appalachian Boi, former Software Developer turned Educator and Streamer

Discussion

markdown guide