func ExecuteTemplateWithCode(w http.ResponseWriter, r *http.Request, code int, name string, data interface{}) {
	t, ok := templates[name]
	if !ok {
		logger.Printf("template/exec: template \"%s\" not found\n", name)
		http.NotFound(w, r)
	}

	w.Header().Set(header.ContentType, "text/html; charset=utf-8")
	w.Header().Set(header.CacheControl, "no-cache, no-store, must-revalidate, max-age=0")
	w.WriteHeader(code)
	buf := bytes.Buffer{}
	err := t.Execute(&buf, data)
	if err != nil {
		logger.Printf("template/exec: execute error; %v\n", err)
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	err = minifier.Minify("text/html", w, &buf)
	if err != nil {
		logger.Printf("template/exec: minify error; %v\n", err)
		return
	}
}
// ExecuteTemplateWithCode executes a template from given name with http code
ExecuteTemplateWithCode executes a template from given name with http code
// ExecuteTemplateWithCode executes a template from given name with http code
func ExecuteTemplateWithCode(w http.ResponseWriter, r *http.Request, code int, name string, data interface{}) {
	t, ok := templates[name]
	if !ok {
		logger.Printf("template/exec: template \"%s\" not found\n", name)
		http.NotFound(w, r)
	}
	w.Header().Set(header.ContentType, "text/html; charset=utf-8")
	w.Header().Set(header.CacheControl, "no-cache, no-store, must-revalidate, max-age=0")
	w.WriteHeader(code)
	buf := bytes.Buffer{}
	err := t.Execute(&buf, data)
	if err != nil {
		logger.Printf("template/exec: execute error; %v\n", err)
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	err = minifier.Minify("text/html", w, &buf)
	if err != nil {
		logger.Printf("template/exec: minify error; %v\n", err)
		return
	}
}
func ExecuteTemplateWithCode ( w http . ResponseWriter , r * http . Request , code int , name string , data interface { } ) { t , ok := templates [ name ] if ! ok { logger . Printf ( " \" \" \n " , name ) http . NotFound ( w , r ) } w . Header ( ) . Set ( header . ContentType , " " ) w . Header ( ) . Set ( header . CacheControl , " " ) w . WriteHeader ( code ) buf := bytes . Buffer { } err := t . Execute ( & buf , data ) if err != nil { logger . Printf ( " \n " , err ) http . Error ( w , err . Error ( ) , http . StatusInternalServerError ) return } err = minifier . Minify ( " " , w , & buf ) if err != nil { logger . Printf ( " \n " , err ) return } }
ExecuteTemplateWithCode executes a template from given name with http code
ExecuteTemplateWithCode executes a template from given name with http code