Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
}
Name: {{ .Name }}
Mail: {{ .Mail }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.