首页 > 解决方案 > http.Dir 的文档在哪里

问题描述

我正在尝试设置一个 go 文件服务器,并在http.Dir(path string) http.FileSystem查看 FileSystem 的文档时遇到了该功能。

在 net/http/fs.go 第 705 行的源代码中,它说:

//To use the operating system's file system implementation,
//
// use http.Dir:
//
//     http.Handle("/", http.FileServer(http.Dir("/tmp")))

但我找不到这个函数的任何文档。我错过了什么吗?

编辑:我错过了它是一种类型

标签: httpgo

解决方案


推荐阅读