프로그래밍 언어로 위키 코드를 작성하려고합니다. /data
폴더에 데이터를 넣었으며 /tmpl
폴더에 .html
개의 파일을 넣었습니다. 내가 panic edit.html not found
을 얻고있다왜 filepath.Walk() 패닉이 발생합니까?
func main() {
walk := func(path string, info os.FileInfo, err error) error {
if err == nil && !info.IsDir() && filepath.Ext(path) == ".html" {
http.HandleFunc("/view/", makeHandler(viewHandler))
http.HandleFunc("/edit/", makeHandler(editHandler))
http.HandleFunc("/save/", makeHandler(saveHandler))
}
return err
}
root := TEMPLATE_PATH + "edit.html"
err := filepath.Walk(root, walk)
if err != nil {
return
}
}
을 다음과 같이
나는 main
기능을 코딩했다. 아무도 날 안내 해줄 수 없습니까? documentation of filepath.Walk에서
TEMPLATE_PATH는 무엇이며 edit.html을 넣는 위치와 관련이 있습니까? 다른 사람의 암호를 따라 다니고 있습니까? – minikomi
var TEMPLATE_PATH : = "tmpl /". – sreeprasad
tmpl 폴더에 edit.html이 있습니까? – minikomi