]> Cypherpunks repositories - gostls13.git/commitdiff
os: make ReadAt comment clearer
authorRuss Cox <rsc@golang.org>
Tue, 22 Nov 2011 17:22:28 +0000 (12:22 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 22 Nov 2011 17:22:28 +0000 (12:22 -0500)
Fixes #2486.

R=golang-dev, hanwen
CC=golang-dev
https://golang.org/cl/5417064

src/pkg/os/file.go

index 386afb889b2c9c3e8e4225e0a013a530d6fe14d8..6a8d346f5c59d73dfd56c01649254c0ceac2dc1c 100644 (file)
@@ -70,8 +70,8 @@ func (file *File) Read(b []byte) (n int, err error) {
 
 // ReadAt reads len(b) bytes from the File starting at byte offset off.
 // It returns the number of bytes read and the error, if any.
-// EOF is signaled by a zero count with err set to io.EOF.
-// ReadAt always returns a non-nil error when n != len(b).
+// ReadAt always returns a non-nil error when n < len(b).
+// At end of file, that error is io.EOF.
 func (file *File) ReadAt(b []byte, off int64) (n int, err error) {
        if file == nil {
                return 0, EINVAL