aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-06-18 22:43:36 -0700
committerIan Lance Taylor <iant@golang.org>2020-06-25 03:11:43 +0000
commit1bb247a469e306c57a5e0eaba788efb8b3b1acef (patch)
tree5b8678e6a8c5d2cf3e90f9d41133834b59aa4a53 /doc
parentd7e3a161f50a45c0c86e2621f99074c38572df82 (diff)
downloadgo-1bb247a469e306c57a5e0eaba788efb8b3b1acef.tar.gz
go-1bb247a469e306c57a5e0eaba788efb8b3b1acef.zip
doc/go1.15: mention consequence of os.File.ReadFrom
Now that we've added a os.File.ReadFrom method, io.CopyBuffer to a os.File will no longer use the provided buffer. For #16474 For #36817 For #37419 Change-Id: I79a3bf778ff93eab88e88dd9ecbb8c7ea101e868 Reviewed-on: https://go-review.googlesource.com/c/go/+/238864 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/go1.15.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/go1.15.html b/doc/go1.15.html
index b6cf5bb8f6..6e98826de2 100644
--- a/doc/go1.15.html
+++ b/doc/go1.15.html
@@ -782,6 +782,20 @@ Do not send CLs removing the interior tags from such phrases.
1.14 with the addition of asynchronous preemption. Now this is
handled transparently.
</p>
+
+ <p><!-- CL 229101 -->
+ The <a href="/pkg/os/#File"><code>os.File</code></a> type now
+ supports a <a href="/pkg/os/#File.ReadFrom"><code>ReadFrom</code></a>
+ method. This permits the use of the <code>copy_file_range</code>
+ system call on some systems when using
+ <a href="/pkg/io/#Copy"><code>io.Copy</code></a> to copy data
+ from one <code>os.File</code> to another. A consequence is that
+ <a href="/pkg/io/#CopyBuffer"><code>io.CopyBuffer</code></a>
+ will not always use the provided buffer when copying to a
+ <code>os.File</code>. If a program wants to force the use of
+ the provided buffer, it can be done by writing
+ <code>io.CopyBuffer(struct{ io.Writer }{dst}, src, buf)</code>.
+ </p>
</dd>
</dl>