aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-11-08 18:30:30 -0800
committerIan Lance Taylor <iant@golang.org>2021-11-09 20:08:48 +0000
commitf48115c6502a3fb791dc4b37f5817024c9731ee3 (patch)
treefeda3a47704b42a3110af3f4dc064f2d497f9af7 /src/os
parent8c20584a8206844be705c50efe8aabb6ab9c503e (diff)
downloadgo-f48115c6502a3fb791dc4b37f5817024c9731ee3.tar.gz
go-f48115c6502a3fb791dc4b37f5817024c9731ee3.zip
os: clarify that File.{Read,Write} use the buffer
Fixes #49470 Change-Id: I81fd4b0e2eef1d8d430b5d1d10c4f824e803a75c Reviewed-on: https://go-review.googlesource.com/c/go/+/362335 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/os')
-rw-r--r--src/os/file.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/os/file.go b/src/os/file.go
index e717f171e7..2823128554 100644
--- a/src/os/file.go
+++ b/src/os/file.go
@@ -109,7 +109,7 @@ func (e *LinkError) Unwrap() error {
return e.Err
}
-// Read reads up to len(b) bytes from the File.
+// Read reads up to len(b) bytes from the File and stores them in b.
// It returns the number of bytes read and any error encountered.
// At end of file, Read returns 0, io.EOF.
func (f *File) Read(b []byte) (n int, err error) {
@@ -166,7 +166,7 @@ type onlyWriter struct {
io.Writer
}
-// Write writes len(b) bytes to the File.
+// Write writes len(b) bytes from b to the File.
// It returns the number of bytes written and an error, if any.
// Write returns a non-nil error when n != len(b).
func (f *File) Write(b []byte) (n int, err error) {