cephfs: remove refs to deprecated io/ioutil

Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
guoguangwu 2023-07-08 13:47:44 +08:00 committed by mergify[bot]
parent a8be907f02
commit 448e4b7f5c
2 changed files with 3 additions and 4 deletions

View File

@ -3,7 +3,7 @@ package admin
import (
"errors"
"fmt"
"io/ioutil"
"io"
"os"
pathpkg "path"
"testing"
@ -57,7 +57,7 @@ func readFile(t *testing.T, mount *cephfs.MountInfo, path string) []byte {
f1, err := mount.Open(path, os.O_RDONLY, 0)
require.NoError(t, err)
defer f1.Close()
b, err := ioutil.ReadAll(f1)
b, err := io.ReadAll(f1)
require.NoError(t, err)
return b
}

View File

@ -3,7 +3,6 @@ package cephfs
import (
"fmt"
"io"
"io/ioutil"
"os"
"testing"
"time"
@ -336,7 +335,7 @@ func TestValidate(t *testing.T) {
}
func TestReadConfigFile(t *testing.T) {
file, err := ioutil.TempFile("/tmp", "cephfs.conf")
file, err := os.CreateTemp("/tmp", "cephfs.conf")
require.NoError(t, err)
defer func() {
assert.NoError(t, file.Close())