package httpserver import ( "html/template" "net/http" ) var tmp *template.Template func templateInit() { tmp, _ = template.ParseGlob("web/templates/*") } func notFound(w http.ResponseWriter, r *http.Request) { w.WriteHeader(404) tmp.ExecuteTemplate(w, "404.html", nil) }