api-machinery: stop using deprecated io/ioutil

This replaces deprecated ioutil functions as follows:

* ioutil.ReadAll -> io.ReadAll
* ioutil.ReadFile -> os.ReadFile
* ioutil.TempDir -> os.MkdirTemp
* ioutil.TempFile -> os.CreateTemp
* ioutil.WriteFile -> os.WriteFile

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: b60a3a58df2791ae67764f6325be31aea5eca5a0
This commit is contained in:
Stephen Kitt 2023-05-02 15:08:18 +02:00 committed by Kubernetes Publisher
parent 41d4a164f9
commit caded3c2dc

View File

@ -23,7 +23,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"io" "io"
"io/ioutil"
"net/http" "net/http"
"net/http/httptest" "net/http/httptest"
"net/url" "net/url"
@ -416,7 +415,7 @@ func TestStreamRandomData(t *testing.T) {
} }
} }
data, err := ioutil.ReadAll(bytes.NewReader(stdout.Bytes())) data, err := io.ReadAll(bytes.NewReader(stdout.Bytes()))
if err != nil { if err != nil {
t.Errorf("error reading the stream: %v", err) t.Errorf("error reading the stream: %v", err)
return return