CHAPTER 5

image

Working with Go Templates

Chapter 4 discussed the fundamentals of web development in Go using the standard library package net/http. A JSON-based web API was created by using the standard library package net/http as the primary web programming block and the third-party package Gorilla mux as the HTTP request multiplexer. This chapter shows you how to develop web applications in Go; the standard library package html/template is used for rendering web pages.

This chapter begins with the fundamentals of Go templates and includes how to develop full-fledged web applications by leveraging the html/template package.

text/template Package ...

Get Web Development with Go: Building Scalable Web Apps and RESTful Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.