]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/godoc: fix `godoc net/http` on windows
authorShenghou Ma <minux.ma@gmail.com>
Fri, 30 Nov 2012 16:42:50 +0000 (00:42 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Fri, 30 Nov 2012 16:42:50 +0000 (00:42 +0800)
`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

src/cmd/godoc/godoc.go

index 9ac38c746e851e7583f36b1601737de7612f8e25..70e1984b2a616a9270aec3d3b9f1612ddb9a3742 100644 (file)
@@ -853,12 +853,12 @@ type docServer struct {
 
 // fsReadDir implements ReadDir for the go/build package.
 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.
 func fsOpenFile(name string) (r io.ReadCloser, err error) {
-       data, err := ReadFile(fs, name)
+       data, err := ReadFile(fs, filepath.ToSlash(name))
        if err != nil {
                return nil, err
        }