func main() { err := cgi.Serve(http.HandlerFunc(handler)) if err != nil { view.ViewFail("request") } }
func handler(w http.ResponseWriter, r *http.Request) { r.Header.Set("Content-Type:", "text/html; charset=UTF-8") handle, err := routing(r.URL.Path) if err != nil { view.ViewFail(err.Error()) } handle(w, r) }