Chapter 5. Displaying content

This chapter covers

  • Templates and template engines
  • The Go template libraries text/template and html/template
  • Actions, pipelines, and functions in templates
  • Nesting of templates and layouts

A web template is a predesigned HTML page that’s used repeatedly by a software program, called a template engine, to generate one or more HTML pages. Web template engines are an important part of any web application framework, and most if not all full-fledged frameworks have one. Although a number of frameworks have embedded template engines, many frameworks use a mix-and-match strategy that allows programmers to choose the template engine they prefer.

Go is no exception. Although Go is a relatively new programming language, ...

Get Go Web Programming 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.