Getting Dynamic
Static assets are generally served as they are, but when you want to create a dynamic page, you might want to make use of an external template, which you can use on the fly, so that you can change the template without having to restart your server, or that you can load on startup, which means you will have to restart your server following any change (this is not strictly true, but we need some concepts of concurrent programming in order to make it happen). Loading a file at startup is executed simply for performance reasons. Filesystem operations are always the slowest, and even if Go is a fairly fast language, you might want to take performance into account when you want to serve your pages, especially if you have many requests from multiple clients.
As you will recall from a previous topic, we used the standard Go templates to make dynamic pages. Now, we can use the template as an external resource and put our template code in an HTML file and load it. The template...