package handle
import (
"html/template"
"net/http"
"utils"
)
var regMap = make(map[string]func(http.ResponseWriter, *http.Request))
regMap["/view"] = func (w http.ResponseWriter, r *http.Request) {
renderTemplate(w, "edit.html", "a")
} // ***这行报:non-declaration statement outside function body***
func Register() {
for url, method := range regMap {
http.HandleFunc(url, method)
}
}
为什么? 等待~
有疑问加站长微信联系(非本文作者)