From: Ian Lance Taylor Date: Fri, 22 Jan 2021 01:29:36 +0000 (-0800) Subject: doc/go1.16: mention os.DirEntry and types moved from os to io/fs X-Git-Tag: go1.16rc1~17 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ad2ca26a52;p=gostls13.git 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 --- 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. +