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/errors | |
| 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/errors')
| -rw-r--r-- | misc/cgo/errors/badsym_test.go | 7 | ||||
| -rw-r--r-- | misc/cgo/errors/errors_test.go | 5 | ||||
| -rw-r--r-- | misc/cgo/errors/ptr_test.go | 9 |
3 files changed, 9 insertions, 12 deletions
diff --git a/misc/cgo/errors/badsym_test.go b/misc/cgo/errors/badsym_test.go index b2701bf922..fc687567bf 100644 --- a/misc/cgo/errors/badsym_test.go +++ b/misc/cgo/errors/badsym_test.go @@ -6,7 +6,6 @@ package errorstest import ( "bytes" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -55,7 +54,7 @@ func TestBadSymbol(t *testing.T) { makeFile := func(mdir, base, source string) string { ret := filepath.Join(mdir, base) - if err := ioutil.WriteFile(ret, []byte(source), 0644); err != nil { + if err := os.WriteFile(ret, []byte(source), 0644); err != nil { t.Fatal(err) } return ret @@ -100,7 +99,7 @@ func TestBadSymbol(t *testing.T) { // _cgo_import.go. rewrite := func(from, to string) { - obj, err := ioutil.ReadFile(from) + obj, err := os.ReadFile(from) if err != nil { t.Fatal(err) } @@ -115,7 +114,7 @@ func TestBadSymbol(t *testing.T) { obj = bytes.ReplaceAll(obj, []byte(magicInput), []byte(magicReplace)) - if err := ioutil.WriteFile(to, obj, 0644); err != nil { + if err := os.WriteFile(to, obj, 0644); err != nil { t.Fatal(err) } } diff --git a/misc/cgo/errors/errors_test.go b/misc/cgo/errors/errors_test.go index 1bdf843451..a077b59478 100644 --- a/misc/cgo/errors/errors_test.go +++ b/misc/cgo/errors/errors_test.go @@ -7,7 +7,6 @@ package errorstest import ( "bytes" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -25,7 +24,7 @@ func check(t *testing.T, file string) { t.Run(file, func(t *testing.T) { t.Parallel() - contents, err := ioutil.ReadFile(path(file)) + contents, err := os.ReadFile(path(file)) if err != nil { t.Fatal(err) } @@ -56,7 +55,7 @@ func check(t *testing.T, file string) { } func expect(t *testing.T, file string, errors []*regexp.Regexp) { - dir, err := ioutil.TempDir("", filepath.Base(t.Name())) + dir, err := os.MkdirTemp("", filepath.Base(t.Name())) if err != nil { t.Fatal(err) } diff --git a/misc/cgo/errors/ptr_test.go b/misc/cgo/errors/ptr_test.go index 4a46b6023b..0f39dc8e54 100644 --- a/misc/cgo/errors/ptr_test.go +++ b/misc/cgo/errors/ptr_test.go @@ -10,7 +10,6 @@ import ( "bytes" "flag" "fmt" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -463,7 +462,7 @@ func buildPtrTests(t *testing.T) (dir, exe string) { gopath = *tmp dir = "" } else { - d, err := ioutil.TempDir("", filepath.Base(t.Name())) + d, err := os.MkdirTemp("", filepath.Base(t.Name())) if err != nil { t.Fatal(err) } @@ -475,7 +474,7 @@ func buildPtrTests(t *testing.T) (dir, exe string) { if err := os.MkdirAll(src, 0777); err != nil { t.Fatal(err) } - if err := ioutil.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil { + if err := os.WriteFile(filepath.Join(src, "go.mod"), []byte("module ptrtest"), 0666); err != nil { t.Fatal(err) } @@ -535,10 +534,10 @@ func buildPtrTests(t *testing.T) (dir, exe string) { fmt.Fprintf(&cgo1, "}\n\n") fmt.Fprintf(&cgo1, "%s\n", ptrTestMain) - if err := ioutil.WriteFile(filepath.Join(src, "cgo1.go"), cgo1.Bytes(), 0666); err != nil { + if err := os.WriteFile(filepath.Join(src, "cgo1.go"), cgo1.Bytes(), 0666); err != nil { t.Fatal(err) } - if err := ioutil.WriteFile(filepath.Join(src, "cgo2.go"), cgo2.Bytes(), 0666); err != nil { + if err := os.WriteFile(filepath.Join(src, "cgo2.go"), cgo2.Bytes(), 0666); err != nil { t.Fatal(err) } |
