diff options
| author | KimMachineGun <geon0250@gmail.com> | 2021-04-03 08:10:47 +0000 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2021-04-05 17:51:15 +0000 |
| commit | a040ebeb980d1a712509fa3d8073cf6ae16cbe78 (patch) | |
| tree | 5dbb3b41a6506cb0251e49a2bf83cccf3aa571c4 /misc/cgo/testshared | |
| parent | 9abedf482752cac0a29c56804f7d34698aa044f2 (diff) | |
| download | go-a040ebeb980d1a712509fa3d8073cf6ae16cbe78.tar.xz | |
all: update references to symbols moved from io/ioutil to io
Update references missed in CL 263142.
For #41190
Change-Id: I778760a6a69bd0440fec0848bdef539c9ccb4ee1
GitHub-Last-Rev: dda42b09fff36dc08ec1cdec50cc19e3da5058e5
GitHub-Pull-Request: golang/go#42874
Reviewed-on: https://go-review.googlesource.com/c/go/+/273946
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'misc/cgo/testshared')
| -rw-r--r-- | misc/cgo/testshared/shared_test.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/misc/cgo/testshared/shared_test.go b/misc/cgo/testshared/shared_test.go index f52391c6f6..e77f848915 100644 --- a/misc/cgo/testshared/shared_test.go +++ b/misc/cgo/testshared/shared_test.go @@ -13,7 +13,6 @@ import ( "fmt" "go/build" "io" - "io/ioutil" "log" "os" "os/exec" @@ -90,7 +89,7 @@ func goCmd(t *testing.T, args ...string) string { // TestMain calls testMain so that the latter can use defer (TestMain exits with os.Exit). func testMain(m *testing.M) (int, error) { - workDir, err := ioutil.TempDir("", "shared_test") + workDir, err := os.MkdirTemp("", "shared_test") if err != nil { return 0, err } @@ -177,7 +176,7 @@ func cloneTestdataModule(gopath string) (string, error) { if err := overlayDir(modRoot, "testdata"); err != nil { return "", err } - if err := ioutil.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module testshared\n"), 0644); err != nil { + if err := os.WriteFile(filepath.Join(modRoot, "go.mod"), []byte("module testshared\n"), 0644); err != nil { return "", err } return modRoot, nil @@ -318,7 +317,7 @@ func TestShlibnameFiles(t *testing.T) { } for _, pkg := range pkgs { shlibnamefile := filepath.Join(gorootInstallDir, pkg+".shlibname") - contentsb, err := ioutil.ReadFile(shlibnamefile) + contentsb, err := os.ReadFile(shlibnamefile) if err != nil { t.Errorf("error reading shlibnamefile for %s: %v", pkg, err) continue @@ -791,7 +790,7 @@ func resetFileStamps() { // It also sets the time of the file, so that we can see if it is rewritten. func touch(t *testing.T, path string) (cleanup func()) { t.Helper() - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) if err != nil { t.Fatal(err) } @@ -837,14 +836,14 @@ func touch(t *testing.T, path string) (cleanup func()) { // user-writable. perm := fi.Mode().Perm() | 0200 - if err := ioutil.WriteFile(path, data, perm); err != nil { + if err := os.WriteFile(path, data, perm); err != nil { t.Fatal(err) } if err := os.Chtimes(path, nearlyNew, nearlyNew); err != nil { t.Fatal(err) } return func() { - if err := ioutil.WriteFile(path, old, perm); err != nil { + if err := os.WriteFile(path, old, perm); err != nil { t.Fatal(err) } } |
