all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTemp

As part of #42026, these helpers from io/ioutil were moved to os.
(ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.)

Update the Go tree to use the preferred names.

As usual, code compiled with the Go 1.4 bootstrap toolchain
and code vendored from other sources is excluded.

ReadDir changes are in a separate CL, because they are not a
simple search and replace.

For #42026.

Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3
Reviewed-on: https://go-review.googlesource.com/c/go/+/266365
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Russ Cox 2020-10-29 14:17:47 -04:00
parent 5627a4dc30
commit 4f1b0a44cb
215 changed files with 556 additions and 704 deletions

View file

@ -10,7 +10,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"reflect"
@ -235,7 +234,7 @@ type resolvConfTest struct {
}
func newResolvConfTest() (*resolvConfTest, error) {
dir, err := ioutil.TempDir("", "go-resolvconftest")
dir, err := os.MkdirTemp("", "go-resolvconftest")
if err != nil {
return nil, err
}