remove io/ioutil

Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
This commit is contained in:
宁明晓10296073
2022-01-11 15:40:07 +08:00
parent 62a4e7020d
commit b35fb7d447
3 changed files with 6 additions and 8 deletions

View File

@@ -21,7 +21,6 @@ package integration
import (
"bytes"
"io/ioutil"
"os"
"strings"
"testing"
@@ -116,7 +115,7 @@ func getCgroupMemoryLimitForTask(t *testing.T, task containerd.Task) uint64 {
func isSwapLikelyEnabled() bool {
// Check whether swap is enabled.
swapFile := "/proc/swaps"
swapData, err := ioutil.ReadFile(swapFile)
swapData, err := os.ReadFile(swapFile)
if err != nil {
// We can't read the file or it doesn't exist, assume we don't have swap.
return false