Skip to content

Instantly share code, notes, and snippets.

@dvas0004
Last active Aug 29, 2015
Embed
What would you like to do?
array golang snippet for http://wp.me/pYwLI-oS
/*
Start Webserver Section
*/
type Page struct {
Title string
Body string
Alerts []string
}
func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) {
err := templates.ExecuteTemplate(w, tmpl+".html", p)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment