Remove deprecated io/ioutil (#15707)

This commit is contained in:
Klaus Post
2022-09-19 20:05:16 +02:00
committed by GitHub
parent 0b6175b742
commit ff12080ff5
89 changed files with 315 additions and 370 deletions

View File

@@ -26,7 +26,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
@@ -334,7 +333,7 @@ func downloadReleaseURL(u *url.URL, timeout time.Duration, mode string) (content
}
}
contentBytes, err := ioutil.ReadAll(resp.Body)
contentBytes, err := io.ReadAll(resp.Body)
if err != nil {
return content, AdminError{
Code: AdminUpdateUnexpectedFailure,
@@ -522,7 +521,7 @@ func downloadBinary(u *url.URL, mode string) (readerReturn []byte, err error) {
}
// convert a Reader to bytes
binaryFile, err := ioutil.ReadAll(reader)
binaryFile, err := io.ReadAll(reader)
if err != nil {
return nil, err
}