Go: go version go1.6.3 darwin/amd64
Ref: https://golang.org/pkg/text/template/#pkg-examples
ご覧のとおりめちゃくちゃはしょっていますが脳内補完してください.
personal_data.tmpl
Name: {{ .Name }}
Mail: {{ .Mail }}
main.go
package main
import (
"bytes"
"fmt"
"html/template"
)
func main() {
type PersonalData struct {
Name string
Mail string
}
p := PersonalData{"おれです", "ore@example.com"}
var b bytes.Buffer
tpl, _ := template.ParseFiles("personal_data.tmpl")
tpl.Execute(&b, p)
fmt.Println(b.String())
// Name: おれです
// Mail: ore@example.com
}