diff options
| author | Andy Pan <panjf2000@gmail.com> | 2022-08-28 03:38:00 +0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2022-09-20 02:13:02 +0000 |
| commit | f8c659b62ff43e8455ebc675e577b9adc67b3f9f (patch) | |
| tree | 967f364a5943aa7323224d56a2eb5c969a81ddbe /src/cmd/internal/obj/ppc64 | |
| parent | 1e7e160d070443147ee38d4de530ce904637a4f3 (diff) | |
| download | go-f8c659b62ff43e8455ebc675e577b9adc67b3f9f.tar.xz | |
all: replace package ioutil with os and io in src
For #45557
Change-Id: I56824135d86452603dd4ed4bab0e24c201bb0683
Reviewed-on: https://go-review.googlesource.com/c/go/+/426257
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/cmd/internal/obj/ppc64')
| -rw-r--r-- | src/cmd/internal/obj/ppc64/asm_test.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/internal/obj/ppc64/asm_test.go b/src/cmd/internal/obj/ppc64/asm_test.go index c96f991293..aef442e485 100644 --- a/src/cmd/internal/obj/ppc64/asm_test.go +++ b/src/cmd/internal/obj/ppc64/asm_test.go @@ -6,11 +6,8 @@ package ppc64 import ( "bytes" - "cmd/internal/obj" - "cmd/internal/objabi" "fmt" "internal/testenv" - "io/ioutil" "math" "os" "os/exec" @@ -18,6 +15,9 @@ import ( "regexp" "strings" "testing" + + "cmd/internal/obj" + "cmd/internal/objabi" ) var platformEnvs = [][]string{ @@ -167,7 +167,7 @@ PNOP func TestPfxAlign(t *testing.T) { testenv.MustHaveGoBuild(t) - dir, err := ioutil.TempDir("", "testpfxalign") + dir, err := os.MkdirTemp("", "testpfxalign") if err != nil { t.Fatalf("could not create directory: %v", err) } @@ -188,7 +188,7 @@ func TestPfxAlign(t *testing.T) { for _, pgm := range pgms { tmpfile := filepath.Join(dir, "x.s") - err = ioutil.WriteFile(tmpfile, pgm.text, 0644) + err = os.WriteFile(tmpfile, pgm.text, 0644) if err != nil { t.Fatalf("can't write output: %v\n", err) } @@ -217,7 +217,7 @@ func TestLarge(t *testing.T) { } testenv.MustHaveGoBuild(t) - dir, err := ioutil.TempDir("", "testlarge") + dir, err := os.MkdirTemp("", "testlarge") if err != nil { t.Fatalf("could not create directory: %v", err) } @@ -281,7 +281,7 @@ func TestLarge(t *testing.T) { gen(buf, test.jmpinsn) tmpfile := filepath.Join(dir, "x.s") - err = ioutil.WriteFile(tmpfile, buf.Bytes(), 0644) + err = os.WriteFile(tmpfile, buf.Bytes(), 0644) if err != nil { t.Fatalf("can't write output: %v\n", err) } @@ -336,7 +336,7 @@ func TestPCalign(t *testing.T) { testenv.MustHaveGoBuild(t) - dir, err := ioutil.TempDir("", "testpcalign") + dir, err := os.MkdirTemp("", "testpcalign") if err != nil { t.Fatalf("could not create directory: %v", err) } @@ -345,7 +345,7 @@ func TestPCalign(t *testing.T) { // generate a test with valid uses of PCALIGN tmpfile := filepath.Join(dir, "x.s") - err = ioutil.WriteFile(tmpfile, []byte(validPCAlignSrc), 0644) + err = os.WriteFile(tmpfile, []byte(validPCAlignSrc), 0644) if err != nil { t.Fatalf("can't write output: %v\n", err) } @@ -385,7 +385,7 @@ func TestPCalign(t *testing.T) { // generate a test with invalid use of PCALIGN tmpfile = filepath.Join(dir, "xi.s") - err = ioutil.WriteFile(tmpfile, []byte(invalidPCAlignSrc), 0644) + err = os.WriteFile(tmpfile, []byte(invalidPCAlignSrc), 0644) if err != nil { t.Fatalf("can't write output: %v\n", err) } |
