报错:non-declaration statement outside function body

milo · · 12541 次点击
David
Life is hard but please enjoy it!
不过看你的程序,其实没意义,Register 里面一行行写就好了,这个map干啥用的?
#4
更多评论
gofmt运行此代码,报:`expected declaration, found 'IDENT' regMap`
#1
polaris
社区,需要你我一同完善!
把 regMap["/view"] = func(w http.ResponseWriter, r *http.Request) { renderTemplate(w, "edit.html", "a") } 放在函数里面。
#2