func executeTemplate(e *engine.Engine, tc template.TemplateConfig) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { body, err := ioutil.ReadAll(r.Body) if err != nil { log.Fatal(err) } result := e.Submit(tc, body) http.Redirect(w, r, fmt.Sprintf("/task/%s", result.Uuid), 303) defer r.Body.Close() } }