ExecuteTemplate renders a specifically named Go template into a writer with supplied data. It becomes necessary when parsing registers multiple templates and Execute cannot determine which one to run. section 11.5.3 section 11.6
Use ExecuteTemplate when templates are loaded together:
- Load files with ParseFS; templates are indexed by their base filenames. section 11.5.3
- Pass the response writer, the registered template name, and the data value. section 11.5.3
- Use Execute directly only when one parsed template leaves no ambiguity. section 11.5.3
Rendering the embedded index template
err = tpl.ExecuteTemplate(w, "index.html", map[string]interface{}{ "Habits": habits, "Date": week, }) if err != nil { // handle rendering failure } section 11.5.3

