diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-07-30 14:28:58 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-08-12 20:23:07 -0700 |
commit | c5b21c3f4c17b0649155035d2f9aa97b2da8a813 (patch) | |
tree | c6d3a68b503ba5b16182acbb958e3e5dbc95a43b /libgo/misc/cgo/testgodefs | |
parent | 72be20e20299ec57b4bc9ba03d5b7d6bf10e97cc (diff) | |
download | gcc-c5b21c3f4c17b0649155035d2f9aa97b2da8a813.zip gcc-c5b21c3f4c17b0649155035d2f9aa97b2da8a813.tar.gz gcc-c5b21c3f4c17b0649155035d2f9aa97b2da8a813.tar.bz2 |
libgo: update to Go1.17rc2
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341629
Diffstat (limited to 'libgo/misc/cgo/testgodefs')
-rw-r--r-- | libgo/misc/cgo/testgodefs/testgodefs_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libgo/misc/cgo/testgodefs/testgodefs_test.go b/libgo/misc/cgo/testgodefs/testgodefs_test.go index 4c2312c..aae3404 100644 --- a/libgo/misc/cgo/testgodefs/testgodefs_test.go +++ b/libgo/misc/cgo/testgodefs/testgodefs_test.go @@ -6,7 +6,6 @@ package testgodefs import ( "bytes" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -34,7 +33,7 @@ func TestGoDefs(t *testing.T) { t.Fatal(err) } - gopath, err := ioutil.TempDir("", "testgodefs-gopath") + gopath, err := os.MkdirTemp("", "testgodefs-gopath") if err != nil { t.Fatal(err) } @@ -58,20 +57,20 @@ func TestGoDefs(t *testing.T) { t.Fatalf("%s: %v\n%s", strings.Join(cmd.Args, " "), err, cmd.Stderr) } - if err := ioutil.WriteFile(filepath.Join(dir, fp+"_defs.go"), out, 0644); err != nil { + if err := os.WriteFile(filepath.Join(dir, fp+"_defs.go"), out, 0644); err != nil { t.Fatal(err) } } - main, err := ioutil.ReadFile(filepath.Join("testdata", "main.go")) + main, err := os.ReadFile(filepath.Join("testdata", "main.go")) if err != nil { t.Fatal(err) } - if err := ioutil.WriteFile(filepath.Join(dir, "main.go"), main, 0644); err != nil { + if err := os.WriteFile(filepath.Join(dir, "main.go"), main, 0644); err != nil { t.Fatal(err) } - if err := ioutil.WriteFile(filepath.Join(dir, "go.mod"), []byte("module testgodefs\ngo 1.14\n"), 0644); err != nil { + if err := os.WriteFile(filepath.Join(dir, "go.mod"), []byte("module testgodefs\ngo 1.14\n"), 0644); err != nil { t.Fatal(err) } |