replace all ioutil with os

Signed-off-by: Benjamin Wang <wachao@vmware.com>
pull/294/head
Benjamin Wang 2022-12-28 16:56:01 +08:00
parent 8e6a1168ae
commit 2385046d41
1 changed files with 4 additions and 4 deletions

View File

@ -228,7 +228,7 @@ func TestOpen_ReadPageSize_FromMeta1_OS(t *testing.T) {
}
// Read data file.
buf, err := ioutil.ReadFile(path)
buf, err := os.ReadFile(path)
if err != nil {
t.Fatal(err)
}
@ -236,7 +236,7 @@ func TestOpen_ReadPageSize_FromMeta1_OS(t *testing.T) {
// Rewrite first meta page.
meta0 := (*meta)(unsafe.Pointer(&buf[pageHeaderSize]))
meta0.pgid++
if err := ioutil.WriteFile(path, buf, 0666); err != nil {
if err := os.WriteFile(path, buf, 0666); err != nil {
t.Fatal(err)
}
@ -270,7 +270,7 @@ func TestOpen_ReadPageSize_FromMeta1_Given(t *testing.T) {
}
// Read data file.
buf, err := ioutil.ReadFile(path)
buf, err := os.ReadFile(path)
if err != nil {
t.Fatal(err)
}
@ -278,7 +278,7 @@ func TestOpen_ReadPageSize_FromMeta1_Given(t *testing.T) {
// Rewrite meta pages.
meta0 := (*meta)(unsafe.Pointer(&buf[pageHeaderSize]))
meta0.pgid++
if err := ioutil.WriteFile(path, buf, 0666); err != nil {
if err := os.WriteFile(path, buf, 0666); err != nil {
t.Fatal(err)
}