package ext import "net/http" type ContentType = string const ( TextHTML ContentType = "text/html" ) func Html(next func(w http.ResponseWriter, r *http.Request)) func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) { next(w, r) } } func SetHTML(w http.ResponseWriter) { SetMIME(w, TextHTML) } func SetMIME(w http.ResponseWriter, mime ContentType) { w.Header().Add("Content-Type", mime) }