From ad2ca26a521a5a642f51c3ef8e3004c9ce7af5aa Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 21 Jan 2021 17:29:36 -0800 Subject: [PATCH] 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 Reviewed-by: Dmitri Shuralyov --- doc/go1.16.html | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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.

+

+ The package defines a new type + DirEntry + as an alias for fs.DirEntry. + The new ReadDir + function and the new + File.ReadDir + method can be used to read the contents of a directory into a + slice of DirEntry. + The File.Readdir + method (note the lower case d in dir) + still exists, returning a slice of + FileInfo, but for + most programs it will be more efficient to switch to + File.ReadDir. +

+

The package now defines CreateTemp, @@ -953,6 +970,18 @@ func TestFoo(t *testing.T) { to be used instead of functions defined in the io/ioutil package.

+ +

+ The types FileInfo, + FileMode, and + PathError + are now aliases for types of the same name in the + io/fs package. + Function signatures in the os + package have been updated to refer to the names in the + io/fs package. + This should not affect any existing code. +