mirror of
https://github.com/distribution/distribution.git
synced 2025-09-24 20:46:52 +00:00
replace deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -7,8 +7,8 @@ import (
|
||||
"crypto/x509"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -89,7 +89,7 @@ func newCloudFrontStorageMiddleware(storageDriver storagedriver.StorageDriver, o
|
||||
}
|
||||
|
||||
// get urlSigner from the file specified in pkPath
|
||||
pkBytes, err := ioutil.ReadFile(pkPath)
|
||||
pkBytes, err := os.ReadFile(pkPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read privatekey file: %s", err)
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
@@ -41,7 +40,7 @@ pZeMRablbPQdp8/1NyIwimq1VlG0ohQ4P6qhW7E09ZMC
|
||||
-----END RSA PRIVATE KEY-----
|
||||
`
|
||||
|
||||
file, err := ioutil.TempFile("", "pkey")
|
||||
file, err := os.CreateTemp("", "pkey")
|
||||
if err != nil {
|
||||
t.Fatal("File cannot be created")
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
@@ -68,7 +68,7 @@ func fetchAWSIPs(url string) (awsIPResponse, error) {
|
||||
return response, err
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
return response, fmt.Errorf("failed to fetch network data. response = %s", body)
|
||||
}
|
||||
decoder := json.NewDecoder(resp.Body)
|
||||
|
Reference in New Issue
Block a user