1
0
mirror of https://github.com/golang/go synced 2024-11-14 07:40:21 -07:00

cmd/godoc: fix godoc net/http on windows

`godoc net/http` used to complain "/target contains more than one package: http, main"

R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6852100
This commit is contained in:
Shenghou Ma 2012-12-01 00:42:50 +08:00
parent 9e30b708a1
commit 279199ebcc

View File

@ -853,12 +853,12 @@ type docServer struct {
// fsReadDir implements ReadDir for the go/build package. // fsReadDir implements ReadDir for the go/build package.
func fsReadDir(dir string) ([]os.FileInfo, error) { func fsReadDir(dir string) ([]os.FileInfo, error) {
return fs.ReadDir(dir) return fs.ReadDir(filepath.ToSlash(dir))
} }
// fsOpenFile implements OpenFile for the go/build package. // fsOpenFile implements OpenFile for the go/build package.
func fsOpenFile(name string) (r io.ReadCloser, err error) { func fsOpenFile(name string) (r io.ReadCloser, err error) {
data, err := ReadFile(fs, name) data, err := ReadFile(fs, filepath.ToSlash(name))
if err != nil { if err != nil {
return nil, err return nil, err
} }