Skip to content

Commit

Permalink
certinfo: replace uses of deprecated io/ioutil
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Nov 20, 2022
1 parent 7025962 commit 7c1b358
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions certinfo/certinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"crypto/x509/pkix"
"errors"
"fmt"
"io/ioutil"
"net"
"os"
"strings"
"time"

Expand Down Expand Up @@ -41,7 +41,7 @@ type Name struct {
StreetAddress string `json:"street_address,omitempty"`
PostalCode string `json:"postal_code,omitempty"`
Names []interface{} `json:"names,omitempty"`
//ExtraNames []interface{} `json:"extra_names,omitempty"`
// ExtraNames []interface{} `json:"extra_names,omitempty"`
}

// ParseName parses a new name from a *pkix.Name
Expand Down Expand Up @@ -105,7 +105,7 @@ func ParseCertificate(cert *x509.Certificate) *Certificate {

// ParseCertificateFile parses x509 certificate file.
func ParseCertificateFile(certFile string) (*Certificate, error) {
certPEM, err := ioutil.ReadFile(certFile)
certPEM, err := os.ReadFile(certFile)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func ParseCSRPEM(csrPEM []byte) (*x509.CertificateRequest, error) {

// ParseCSRFile uses the helper to parse an x509 CSR PEM file.
func ParseCSRFile(csrFile string) (*x509.CertificateRequest, error) {
csrPEM, err := ioutil.ReadFile(csrFile)
csrPEM, err := os.ReadFile(csrFile)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7c1b358

Please sign in to comment.