]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: clarify semantics of File methods
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 13 Jan 2014 21:52:06 +0000 (13:52 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 13 Jan 2014 21:52:06 +0000 (13:52 -0800)
There were no docs explaining the meaning of Readdir's count
argument, for instance. Clarify that these mean the same as
the methods on *os.File.

R=golang-codereviews, minux.ma
CC=golang-codereviews
https://golang.org/cl/51630043

src/pkg/net/http/fs.go

index 8b32ca1d0eaf4652d4bbf649657a793124458c68..042e6da113b02a7f39d79306497bef425b9e944b 100644 (file)
@@ -52,12 +52,14 @@ type FileSystem interface {
 
 // A File is returned by a FileSystem's Open method and can be
 // served by the FileServer implementation.
+//
+// The methods should behave the same as those on an *os.File.
 type File interface {
-       Close() error
-       Stat() (os.FileInfo, error)
+       io.Closer
+       io.Reader
        Readdir(count int) ([]os.FileInfo, error)
-       Read([]byte) (int, error)
        Seek(offset int64, whence int) (int64, error)
+       Stat() (os.FileInfo, error)
 }
 
 func dirList(w ResponseWriter, f File) {