mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-06 01:20:40 +00:00
Remove ioutil from client-go
Signed-off-by: inosato <si17_21@yahoo.co.jp> Kubernetes-commit: 88dfa51b6003c90e8f0a0508939a1d79950a40df
This commit is contained in:
committed by
Kubernetes Publisher
parent
2e404084ad
commit
27de641f75
@@ -17,7 +17,7 @@ limitations under the License.
|
||||
package testing
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
@@ -83,7 +83,7 @@ func (f *FakeHandler) ServeHTTP(response http.ResponseWriter, request *http.Requ
|
||||
response.WriteHeader(f.StatusCode)
|
||||
response.Write([]byte(f.ResponseBody))
|
||||
|
||||
bodyReceived, err := ioutil.ReadAll(request.Body)
|
||||
bodyReceived, err := io.ReadAll(request.Body)
|
||||
if err != nil && f.T != nil {
|
||||
f.T.Logf("Received read error: %v", err)
|
||||
}
|
||||
|
@@ -18,8 +18,8 @@ package testing
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/fs"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
@@ -71,7 +71,7 @@ func NewFakeOpenAPIV3Server(specsPath string) (*FakeOpenAPIServer, error) {
|
||||
}
|
||||
|
||||
defer file.Close()
|
||||
vals, err := ioutil.ReadAll(file)
|
||||
vals, err := io.ReadAll(file)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@@ -17,7 +17,6 @@ limitations under the License.
|
||||
package testing
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
@@ -26,7 +25,7 @@ import (
|
||||
// deleted with a call to "os.RemoveAll(...)".
|
||||
// In case of error, it'll return an empty string and the error.
|
||||
func MkTmpdir(prefix string) (string, error) {
|
||||
tmpDir, err := ioutil.TempDir(os.TempDir(), prefix)
|
||||
tmpDir, err := os.MkdirTemp(os.TempDir(), prefix)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
Reference in New Issue
Block a user