diff options
author | Alexander Rakoczy <alex@golang.org> | 2020-12-14 11:42:42 -0500 |
---|---|---|
committer | Alexander Rakoczy <alex@golang.org> | 2020-12-14 11:42:42 -0500 |
commit | 267975dc4732b6f6a62a7d33a85de34efef180b7 (patch) | |
tree | fd69c51067a279d959b233b94bccf2bf969317a7 /src/syscall/syscall_linux_test.go | |
parent | 63bc23b5452f6605df3e40ce7ecdd8b0348792af (diff) | |
parent | 6c64b6db6802818dd9a4789cdd564f19b70b6b4c (diff) | |
download | go-git-267975dc4732b6f6a62a7d33a85de34efef180b7.tar.gz |
Merge branch 'master' into dev.regabi
Change-Id: I098acdbc5e2676aeb8700d935e796a9c29d04b88
Diffstat (limited to 'src/syscall/syscall_linux_test.go')
-rw-r--r-- | src/syscall/syscall_linux_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/syscall/syscall_linux_test.go b/src/syscall/syscall_linux_test.go index 92764323ee..153d0efef1 100644 --- a/src/syscall/syscall_linux_test.go +++ b/src/syscall/syscall_linux_test.go @@ -9,7 +9,6 @@ import ( "fmt" "io" "io/fs" - "io/ioutil" "os" "os/exec" "os/signal" @@ -30,7 +29,7 @@ func chtmpdir(t *testing.T) func() { if err != nil { t.Fatalf("chtmpdir: %v", err) } - d, err := ioutil.TempDir("", "test") + d, err := os.MkdirTemp("", "test") if err != nil { t.Fatalf("chtmpdir: %v", err) } @@ -160,7 +159,7 @@ func TestLinuxDeathSignal(t *testing.T) { // Copy the test binary to a location that a non-root user can read/execute // after we drop privileges - tempDir, err := ioutil.TempDir("", "TestDeathSignal") + tempDir, err := os.MkdirTemp("", "TestDeathSignal") if err != nil { t.Fatalf("cannot create temporary directory: %v", err) } @@ -321,7 +320,7 @@ func TestSyscallNoError(t *testing.T) { // Copy the test binary to a location that a non-root user can read/execute // after we drop privileges - tempDir, err := ioutil.TempDir("", "TestSyscallNoError") + tempDir, err := os.MkdirTemp("", "TestSyscallNoError") if err != nil { t.Fatalf("cannot create temporary directory: %v", err) } @@ -543,7 +542,7 @@ func TestAllThreadsSyscall(t *testing.T) { func compareStatus(filter, expect string) error { expected := filter + expect pid := syscall.Getpid() - fs, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/task", pid)) + fs, err := os.ReadDir(fmt.Sprintf("/proc/%d/task", pid)) if err != nil { return fmt.Errorf("unable to find %d tasks: %v", pid, err) } @@ -551,7 +550,7 @@ func compareStatus(filter, expect string) error { foundAThread := false for _, f := range fs { tf := fmt.Sprintf("/proc/%s/status", f.Name()) - d, err := ioutil.ReadFile(tf) + d, err := os.ReadFile(tf) if err != nil { // There are a surprising number of ways this // can error out on linux. We've seen all of |