package main import ( "net/http" "text/template" ) func init() { http.HandleFunc("/edit/", editHandler) } var edittmpl = template.Must(template.ParseFiles("tmpl/root", "tmpl/edit")) func editHandler(w http.ResponseWriter, r *http.Request) { title := r.URL.Path[len("/edit/"):] p, _ := loadPage(title) p.render(w, edittmpl) }