- 分类:【Golang】
- 浏览【1213】
- 评论【0】
- 更新【2018-6-29 21:05:59】
go可以很容易实现一个文件服务器,只需要使用函数 func ServeFile(w ResponseWriter, r *Request, name string)即可。 package main import ( "log" "net/http" "fmt" ) func helloHandler(res http.ResponseWriter, req *http.Request) { http.ServeFile(res, req, "E:/go-work/src/go-learning/foo.xlsx") } func main() { fmt.Println("web
阅读全文