aboutsummaryrefslogtreecommitdiff
path: root/misc/cgo/testcshared
diff options
context:
space:
mode:
authorKimMachineGun <geon0250@gmail.com>2021-04-03 08:10:47 +0000
committerIan Lance Taylor <iant@golang.org>2021-04-05 17:51:15 +0000
commita040ebeb980d1a712509fa3d8073cf6ae16cbe78 (patch)
tree5dbb3b41a6506cb0251e49a2bf83cccf3aa571c4 /misc/cgo/testcshared
parent9abedf482752cac0a29c56804f7d34698aa044f2 (diff)
downloadgo-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/testcshared')
-rw-r--r--misc/cgo/testcshared/cshared_test.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/misc/cgo/testcshared/cshared_test.go b/misc/cgo/testcshared/cshared_test.go
index 3a4886cf30..90d8c365e6 100644
--- a/misc/cgo/testcshared/cshared_test.go
+++ b/misc/cgo/testcshared/cshared_test.go
@@ -11,7 +11,6 @@ import (
"encoding/binary"
"flag"
"fmt"
- "io/ioutil"
"log"
"os"
"os/exec"
@@ -125,7 +124,7 @@ func testMain(m *testing.M) int {
// Copy testdata into GOPATH/src/testcshared, along with a go.mod file
// declaring the same path.
- GOPATH, err := ioutil.TempDir("", "cshared_test")
+ GOPATH, err := os.MkdirTemp("", "cshared_test")
if err != nil {
log.Panic(err)
}
@@ -140,7 +139,7 @@ func testMain(m *testing.M) int {
log.Panic(err)
}
os.Setenv("PWD", modRoot)
- if err := ioutil.WriteFile("go.mod", []byte("module testcshared\n"), 0666); err != nil {
+ if err := os.WriteFile("go.mod", []byte("module testcshared\n"), 0666); err != nil {
log.Panic(err)
}
@@ -260,7 +259,7 @@ func createHeaders() error {
// The 'cgo' command generates a number of additional artifacts,
// but we're only interested in the header.
// Shunt the rest of the outputs to a temporary directory.
- objDir, err := ioutil.TempDir("", "testcshared_obj")
+ objDir, err := os.MkdirTemp("", "testcshared_obj")
if err != nil {
return err
}
@@ -381,7 +380,7 @@ func main() {
srcfile := filepath.Join(tmpdir, "test.go")
objfile := filepath.Join(tmpdir, "test.dll")
- if err := ioutil.WriteFile(srcfile, []byte(prog), 0666); err != nil {
+ if err := os.WriteFile(srcfile, []byte(prog), 0666); err != nil {
t.Fatal(err)
}
argv := []string{"build", "-buildmode=c-shared"}
@@ -643,7 +642,7 @@ func TestPIE(t *testing.T) {
// Test that installing a second time recreates the header file.
func TestCachedInstall(t *testing.T) {
- tmpdir, err := ioutil.TempDir("", "cshared")
+ tmpdir, err := os.MkdirTemp("", "cshared")
if err != nil {
t.Fatal(err)
}
@@ -719,14 +718,14 @@ func TestCachedInstall(t *testing.T) {
// copyFile copies src to dst.
func copyFile(t *testing.T, dst, src string) {
t.Helper()
- data, err := ioutil.ReadFile(src)
+ data, err := os.ReadFile(src)
if err != nil {
t.Fatal(err)
}
if err := os.MkdirAll(filepath.Dir(dst), 0777); err != nil {
t.Fatal(err)
}
- if err := ioutil.WriteFile(dst, data, 0666); err != nil {
+ if err := os.WriteFile(dst, data, 0666); err != nil {
t.Fatal(err)
}
}
@@ -743,7 +742,7 @@ func TestGo2C2Go(t *testing.T) {
t.Parallel()
- tmpdir, err := ioutil.TempDir("", "cshared-TestGo2C2Go")
+ tmpdir, err := os.MkdirTemp("", "cshared-TestGo2C2Go")
if err != nil {
t.Fatal(err)
}