最近写程序发现静态文件的路径不对,因此写了一段小的代码验证路径的起始位置

1
2
3
4
5
6
7
8
9
10
package main
import (
"net/http"
)
func main() {
http.Handle("/", http.FileServer(http.Dir("./")))
http.ListenAndServe(":8111", nil)
}