Skip to content

Instantly share code, notes, and snippets.

@dvas0004
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvas0004/e8c5d90cb1033377234b to your computer and use it in GitHub Desktop.
Save dvas0004/e8c5d90cb1033377234b to your computer and use it in GitHub Desktop.
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