Replaced deprecated io/ioutil functions (#768)

Signed-off-by: slab713 <109306207+slab713@users.noreply.github.com>
This commit is contained in:
slab713
2022-09-02 14:56:02 +02:00
committed by GitHub
parent 6ae793eb51
commit 8ffb053cec
36 changed files with 249 additions and 280 deletions
+3 -3
View File
@@ -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
}