all: update references to symbols moved from io/ioutil to io

The old ioutil references are still valid, but update our code
to reflect best practices and get used to the new locations.

Code compiled with the bootstrap toolchain
(cmd/asm, cmd/dist, cmd/compile, debug/elf)
must remain Go 1.4-compatible and is excluded.
Also excluded vendored code.

For #41190.

Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/263142
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
This commit is contained in:
Russ Cox 2020-10-16 00:49:02 -04:00
parent cb0a0f52e6
commit 1b09d43067
135 changed files with 535 additions and 597 deletions

View file

@ -7,7 +7,6 @@ package json
import (
"bytes"
"io"
"io/ioutil"
"log"
"net"
"net/http"
@ -215,7 +214,7 @@ func TestDecoderBuffered(t *testing.T) {
if m.Name != "Gopher" {
t.Errorf("Name = %q; want Gopher", m.Name)
}
rest, err := ioutil.ReadAll(d.Buffered())
rest, err := io.ReadAll(d.Buffered())
if err != nil {
t.Fatal(err)
}
@ -318,7 +317,7 @@ func BenchmarkEncoderEncode(b *testing.B) {
v := &T{"foo", "bar"}
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
if err := NewEncoder(ioutil.Discard).Encode(v); err != nil {
if err := NewEncoder(io.Discard).Encode(v); err != nil {
b.Fatal(err)
}
}