windows下找不到路径
来源:17-10 实现前端展示页面

慕圣3803483
2019-09-01
在运行starter.go
时,template
的路径找不到,会报panic
: panic: open crawler/frontend/view/template.html: The system cannot find the path specified.
starter.go
import (
"net/http"
"xingxiaoli.com/xingxiaoli/crawler/frontend/controller"
)
func main() {
http.Handle("/search",
controller.CreateSearchResultHandler(
"crawler/frontend/view/template.html"))
err := http.ListenAndServe(":8888", nil)
if err != nil {
panic(err)
}
}
写回答
1回答
-
ccmouse
2019-09-08
这个你直接在当时的命令行尝试dir crawler/frontend/view/template.html,它应该也找不到。然后你看一下具体目录哪里错了,尝试cd到正确的目录或者改一下路径,再运行。
00
相似问题