mirror of https://github.com/ceph/go-ceph
cephfs: remove refs to deprecated io/ioutil
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
parent
a8be907f02
commit
448e4b7f5c
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue