Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
array golang snippet for
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