Use `ExecuteTemplate` when several named templates have been parsed together and you need to choose which one renders. Unlike `Execute`, which uses the first template listed in `ParseFiles`, it takes the template name explicitly. section 9.1.5
Render a page with a shared head
Parse `index.html` and `head.html` into one template object, then call `t.ExecuteTemplate(w, "index.html", p)` in an HTTP handler. The index template can include `{{template "head.html" .}}`; passing `.` makes the page data, including `Title`, available to the head template. section 9.1.5
Listing 9.10 Using the nested templates
package main
import (
"html/template"
"net/http"
)
var t *template.Template
func init() {
t = template.Must(template.ParseFiles("index.html
", "head.html")) #1
}
type Page struct {
Title, Content string
}
func displayPage(w http.ResponseWriter, r *http.Request) {
p := &Page{
Title: "An Example",
Content: "Have fun stormin' da castle.",
}
t.ExecuteTemplate(w, "index.html", p) #2
}
func main() {
http.HandleFunc("/", displayPage) #3
http.ListenAndServe(":8080", nil) #3
}
The complete Go handler parses both files and selects `index.html` for the HTTP response. section 9.1.5

