Step-8 Template Caching
- Refactor to call
ParseFiles
once at program initialization, parsing all templates into a single*Template
. - Create the global variable named
templates
, and initialize it withParseFiles
. - Modify the
renderTemplate
function to call thetemplates.ExecuteTemplate
method with the name of the appropriate template.