mirror of
https://github.com/opencontainers/runc.git
synced 2025-11-03 09:51:06 +08:00
Remove io/ioutil use
See https://golang.org/doc/go1.16#ioutil Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -3,7 +3,6 @@ package libcontainer
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -18,10 +17,10 @@ func testMemoryNotification(t *testing.T, evName string, notify notifyFunc, targ
|
||||
memoryPath := t.TempDir()
|
||||
evFile := filepath.Join(memoryPath, evName)
|
||||
eventPath := filepath.Join(memoryPath, "cgroup.event_control")
|
||||
if err := ioutil.WriteFile(evFile, []byte{}, 0o700); err != nil {
|
||||
if err := os.WriteFile(evFile, []byte{}, 0o700); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := ioutil.WriteFile(eventPath, []byte{}, 0o700); err != nil {
|
||||
if err := os.WriteFile(eventPath, []byte{}, 0o700); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ch, err := notify(memoryPath)
|
||||
@@ -29,7 +28,7 @@ func testMemoryNotification(t *testing.T, evName string, notify notifyFunc, targ
|
||||
t.Fatal("expected no error, got:", err)
|
||||
}
|
||||
|
||||
data, err := ioutil.ReadFile(eventPath)
|
||||
data, err := os.ReadFile(eventPath)
|
||||
if err != nil {
|
||||
t.Fatal("couldn't read event control file:", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user