diff options
author | Russ Cox <rsc@golang.org> | 2020-10-16 00:49:02 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2020-10-20 18:41:18 +0000 |
commit | 1b09d430678d4a6f73b2443463d11f75851aba8a (patch) | |
tree | fec040abfc6e1d897f8dcdbb856e77d5bccbb2ca /src/internal | |
parent | cb0a0f52e67f128c6ad69027c9a8c7a5caf58446 (diff) | |
download | go-1b09d430678d4a6f73b2443463d11f75851aba8a.tar.gz go-1b09d430678d4a6f73b2443463d11f75851aba8a.zip |
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>
Diffstat (limited to 'src/internal')
-rw-r--r-- | src/internal/obscuretestdata/obscuretestdata.go | 2 | ||||
-rw-r--r-- | src/internal/profile/profile.go | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/internal/obscuretestdata/obscuretestdata.go b/src/internal/obscuretestdata/obscuretestdata.go index 512f3759b4..06cd1df22c 100644 --- a/src/internal/obscuretestdata/obscuretestdata.go +++ b/src/internal/obscuretestdata/obscuretestdata.go @@ -47,5 +47,5 @@ func ReadFile(name string) ([]byte, error) { return nil, err } defer f.Close() - return ioutil.ReadAll(base64.NewDecoder(base64.StdEncoding, f)) + return io.ReadAll(base64.NewDecoder(base64.StdEncoding, f)) } diff --git a/src/internal/profile/profile.go b/src/internal/profile/profile.go index a6275bc6de..29568aa4b5 100644 --- a/src/internal/profile/profile.go +++ b/src/internal/profile/profile.go @@ -12,7 +12,6 @@ import ( "compress/gzip" "fmt" "io" - "io/ioutil" "regexp" "strings" "time" @@ -125,7 +124,7 @@ type Function struct { // may be a gzip-compressed encoded protobuf or one of many legacy // profile formats which may be unsupported in the future. func Parse(r io.Reader) (*Profile, error) { - orig, err := ioutil.ReadAll(r) + orig, err := io.ReadAll(r) if err != nil { return nil, err } @@ -136,7 +135,7 @@ func Parse(r io.Reader) (*Profile, error) { if err != nil { return nil, fmt.Errorf("decompressing profile: %v", err) } - data, err := ioutil.ReadAll(gz) + data, err := io.ReadAll(gz) if err != nil { return nil, fmt.Errorf("decompressing profile: %v", err) } |