From e6b6d107f7157bb515564f628e5b9b455e295db3 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 21 Jan 2021 16:23:18 -0800 Subject: [PATCH] doc/go1.16: mention deprecation of io/ioutil For #40025 For #40700 For #42026 Change-Id: Ib51b5e1398c4eb811506df21e3bd56dd84bd1f7e Reviewed-on: https://go-review.googlesource.com/c/go/+/285377 Trust: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- doc/go1.16.html | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/doc/go1.16.html b/doc/go1.16.html index 0330ec6b245..37a2160944b 100644 --- a/doc/go1.16.html +++ b/doc/go1.16.html @@ -499,6 +499,44 @@ func TestFoo(t *testing.T) { implementations.

+

Deprecation of io/ioutil

+ +

+ The io/ioutil package has + turned out to be a poorly defined and hard to understand collection + of things. All functionality provided by the package has been moved + to other packages. The io/ioutil package remains and + will continue to work as before, but we encourage new code to use + the new definitions in the io and + os packages. + + Here is a list of the new locations of the names exported + by io/ioutil: +

+

+ + The package now defines + Discard, + NopCloser, and + ReadAll, + to be used instead of the same names in the + io/ioutil package. +

@@ -896,6 +943,16 @@ func TestFoo(t *testing.T) { instead of the unexported errFinished when the process has already finished.

+ +

+ The package now defines + CreateTemp, + MkdirTemp, + ReadFile, and + WriteFile, + to be used instead of functions defined in the + io/ioutil package. +