Move from deprecated ioutil to os and io packages (#744)

This commit is contained in:
KallyDev 2021-09-29 02:49:34 +08:00 committed by GitHub
parent 1ef824c0b4
commit 4abf98c1be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 29 additions and 43 deletions

View file

@ -4,7 +4,7 @@ import (
"bytes"
"crypto/x509"
"encoding/pem"
"io/ioutil"
"io"
"net/http"
"os"
@ -74,7 +74,7 @@ func GetOCSPForCert(cert [][]byte) ([]byte, error) {
}
defer resp.Body.Close()
issuerBytes, errC := ioutil.ReadAll(resp.Body)
issuerBytes, errC := io.ReadAll(resp.Body)
if errC != nil {
return nil, newError(errC)
}
@ -98,7 +98,7 @@ func GetOCSPForCert(cert [][]byte) ([]byte, error) {
return nil, newError(err)
}
defer req.Body.Close()
ocspResBytes, err := ioutil.ReadAll(req.Body)
ocspResBytes, err := io.ReadAll(req.Body)
if err != nil {
return nil, newError(err)