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

This commit is contained in:
KallyDev 2021-09-30 01:17:48 +08:00 committed by GitHub
parent 059fc32f00
commit c48fadc4a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 71 additions and 84 deletions

View file

@ -23,7 +23,7 @@ import (
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"os"
"strings"
)
@ -137,11 +137,11 @@ type KeyPair struct {
func (kp KeyPair) Load() (*x509.Certificate, interface{}, error) {
switch kp.Format {
case "", "pem_file":
certData, err := ioutil.ReadFile(kp.Certificate)
certData, err := os.ReadFile(kp.Certificate)
if err != nil {
return nil, nil, err
}
keyData, err := ioutil.ReadFile(kp.PrivateKey)
keyData, err := os.ReadFile(kp.PrivateKey)
if err != nil {
return nil, nil, err
}