mirror of
https://github.com/golang/go
synced 2024-11-13 17:10: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:
parent
9e30b708a1
commit
279199ebcc
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user