mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 12:28:01 +08:00
Replaced deprecated io/ioutil functions (#768)
Signed-off-by: slab713 <109306207+slab713@users.noreply.github.com>
This commit is contained in:
+3
-3
@@ -10,7 +10,7 @@ import (
|
||||
"crypto/x509"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
@@ -131,7 +131,7 @@ func doHTTPRequest(req *http.Request, verifyTLS bool, resultsPtr interface{}) (h
|
||||
return nil, zotErrors.ErrUnauthorizedAccess
|
||||
}
|
||||
|
||||
bodyBytes, _ := ioutil.ReadAll(resp.Body)
|
||||
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||
|
||||
return nil, errors.New(string(bodyBytes)) //nolint: goerr113
|
||||
}
|
||||
@@ -179,7 +179,7 @@ func getTLSConfig(certsPath string, caCertPool *x509.CertPool) (*tls.Config, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
caCert, err := ioutil.ReadFile(caCertFile)
|
||||
caCert, err := os.ReadFile(caCertFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user