From 1bb247a469e306c57a5e0eaba788efb8b3b1acef Mon Sep 17 00:00:00 2001
From: Ian Lance Taylor
Date: Thu, 18 Jun 2020 22:43:36 -0700
Subject: [PATCH] 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
---
doc/go1.15.html | 14 ++++++++++++++
1 file changed, 14 insertions(+)
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.
+
+
+ The os.File
type now
+ supports a ReadFrom
+ method. This permits the use of the copy_file_range
+ system call on some systems when using
+ io.Copy
to copy data
+ from one os.File
to another. A consequence is that
+ io.CopyBuffer
+ will not always use the provided buffer when copying to a
+ os.File
. If a program wants to force the use of
+ the provided buffer, it can be done by writing
+ io.CopyBuffer(struct{ io.Writer }{dst}, src, buf)
.
+
--
2.50.0