delete io/ioutil package. (#5955)

Signed-off-by: yanggang <gang.yang@daocloud.io>
This commit is contained in:
杨刚 (成都)
2023-03-16 09:25:58 +08:00
committed by GitHub
parent 1d8ca4f2ef
commit ad9c6e8dee
31 changed files with 92 additions and 83 deletions

View File

@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,6 +16,7 @@ limitations under the License.
package process
import (
"io/fs"
"os"
"sort"
"testing"
@@ -43,7 +44,7 @@ func TestNewRegistry(t *testing.T) {
}
type fakeFileInfo struct {
os.FileInfo
fs.FileInfo
mode os.FileMode
}

View File

@@ -17,7 +17,7 @@ limitations under the License.
package clientmgmt
import (
"io/ioutil"
"io"
"strings"
"testing"
"time"
@@ -208,7 +208,7 @@ func TestRestartableObjectStoreDelegatedFunctions(t *testing.T) {
Function: "GetObject",
Inputs: []interface{}{"bucket", "key"},
ExpectedErrorOutputs: []interface{}{nil, errors.Errorf("reset error")},
ExpectedDelegateOutputs: []interface{}{ioutil.NopCloser(strings.NewReader("object")), errors.Errorf("delegate error")},
ExpectedDelegateOutputs: []interface{}{io.NopCloser(strings.NewReader("object")), errors.Errorf("delegate error")},
},
restartabletest.RestartableDelegateTest{
Function: "ListCommonPrefixes",

View File

@@ -18,7 +18,7 @@ package framework
import (
"bytes"
"io/ioutil"
"io"
"testing"
"github.com/stretchr/testify/assert"
@@ -59,7 +59,7 @@ func TestStreamReader(t *testing.T) {
close: rdr.CloseSend,
}
res, err := ioutil.ReadAll(sr)
res, err := io.ReadAll(sr)
require.Nil(t, err)
assert.Equal(t, s, string(res))