This four part series explores Go's template package, which can be used to render HTML or text. Topics covered include contextual encoding, actions, using functions in templates, and how to build a proper view layer for a web application.
Learn how to create a reusable view layer to simplify HTML rendering. This includes creating a shared layout, defining default templates that can be overridden, and including the same templates across various pages without putting all of the code into a single file.
This article on Go templates explains how to use common actions like if/else and range to create more dynamic outputs. After that we examine how to create nested templates and use them to avoid code repition.
Sign up for my mailing list and I'll send you a FREE sample from my course - Web Development with Go. The sample includes three chapters from the book, and over 2.5 hours of screencasts.
You will also receive notifications when I release new articles, along with other freebies that I only share with my mailing list.
Jon Calhoun is a full stack web developer who also teaches about Go, web development, algorithms, and anything programming related. He also consults for other companies who have development needs. (If you need some development work done, get in touch!)
Jon is a co-founder of EasyPost, a shipping API that many fortune 500 companies use to power their shipping infrastructure, and prior to founding EasyPost he worked at google as a software engineer.
©2018 Jonathan Calhoun. All rights reserved.