Skip to content

Instantly share code, notes, and snippets.

@remogatto
Created July 19, 2011 16:31
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 remogatto/1092989 to your computer and use it in GitHub Desktop.
Save remogatto/1092989 to your computer and use it in GitHub Desktop.
func (fn Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache")
t := NewTemplate(w)
if err := fn(t, r); err != nil {
Logf("%s", err.Error)
err.ShowError(w)
return
}
if t.Data != nil {
if err := t.Execute(fn); err != nil {
Logf("%s", err.Error)
err.ShowError(w)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment