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到正确的目录或者改一下路径,再运行。

0
0

Google资深工程师深度讲解Go语言 由浅入深掌握Go语言

语法+分布式爬虫实战 为转型工程师量身打造

5995 学习 · 1909 问题

查看课程