Do not use ioutil as it is deprecated (#2625)

This commit is contained in:
Neil Alexander 2022-08-05 10:26:59 +01:00 committed by GitHub
parent 1b7f84250a
commit c8935fb53f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 52 additions and 60 deletions

View file

@ -22,7 +22,6 @@ import (
"encoding/pem"
"errors"
"fmt"
"io/ioutil"
"math/big"
"os"
"strings"
@ -144,7 +143,7 @@ func NewTLSKeyWithAuthority(serverName, tlsKeyPath, tlsCertPath, authorityKeyPat
}
// load the authority key
dat, err := ioutil.ReadFile(authorityKeyPath)
dat, err := os.ReadFile(authorityKeyPath)
if err != nil {
return err
}
@ -158,7 +157,7 @@ func NewTLSKeyWithAuthority(serverName, tlsKeyPath, tlsCertPath, authorityKeyPat
}
// load the authority certificate
dat, err = ioutil.ReadFile(authorityCertPath)
dat, err = os.ReadFile(authorityCertPath)
if err != nil {
return err
}