aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-01-21 17:29:36 -0800
committerIan Lance Taylor <iant@golang.org>2021-01-25 23:53:53 +0000
commitad2ca26a521a5a642f51c3ef8e3004c9ce7af5aa (patch)
tree956acefe7ad4681d1b188b70f5792db0b7e9d2f5 /doc
parenta51921fa5b1398227efd61ceb3991313f037d7fa (diff)
downloadgo-ad2ca26a521a5a642f51c3ef8e3004c9ce7af5aa.tar.gz
go-ad2ca26a521a5a642f51c3ef8e3004c9ce7af5aa.zip
doc/go1.16: mention os.DirEntry and types moved from os to io/fs
For #40700 For #41467 For #41190 Change-Id: Id94e7511c98c38a22b1f9a55af6e200c9df07fd3 Reviewed-on: https://go-review.googlesource.com/c/go/+/285592 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/go1.16.html29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/go1.16.html b/doc/go1.16.html
index 1a88568acb..e1e8c7a833 100644
--- a/doc/go1.16.html
+++ b/doc/go1.16.html
@@ -944,6 +944,23 @@ func TestFoo(t *testing.T) {
already finished.
</p>
+ <p><!-- CL 261540 -->
+ The package defines a new type
+ <a href="/pkg/os/#DirEntry"><code>DirEntry</code></a>
+ as an alias for <a href="/pkg/io/fs/#DirEntry"><code>fs.DirEntry</code></a>.
+ The new <a href="/pkg/os/#ReadDir"><code>ReadDir</code></a>
+ function and the new
+ <a href="/pkg/os/#File.ReadDir"><code>File.ReadDir</code></a>
+ method can be used to read the contents of a directory into a
+ slice of <a href="/pkg/os/#DirEntry"><code>DirEntry</code></a>.
+ The <a href="/pkg/os/#File.Readdir"><code>File.Readdir</code></a>
+ method (note the lower case <code>d</code> in <code>dir</code>)
+ still exists, returning a slice of
+ <a href="/pkg/os/#FileInfo"><code>FileInfo</code></a>, but for
+ most programs it will be more efficient to switch to
+ <a href="/pkg/os/#File.ReadDir"><code>File.ReadDir</code></a>.
+ </p>
+
<p><!-- CL 263141 -->
The package now defines
<a href="/pkg/os/#CreateTemp"><code>CreateTemp</code></a>,
@@ -953,6 +970,18 @@ func TestFoo(t *testing.T) {
to be used instead of functions defined in the
<a href="/pkg/io/ioutil/"><code>io/ioutil</code></a> package.
</p>
+
+ <p><!-- CL 243906 -->
+ The types <a href="/pkg/os/#FileInfo"><code>FileInfo</code></a>,
+ <a href="/pkg/os/#FileMode"><code>FileMode</code></a>, and
+ <a href="/pkg/os/#PathError"><code>PathError</code></a>
+ are now aliases for types of the same name in the
+ <a href="/pkg/io/fs/"><code>io/fs</code></a> package.
+ Function signatures in the <a href="/pkg/os/"><code>os</code></a>
+ package have been updated to refer to the names in the
+ <a href="/pkg/io/fs/"><code>io/fs</code></a> package.
+ This should not affect any existing code.
+ </p>
</dd>
</dl><!-- os -->