From 7c1b3588da2292c39966676b118cb72d3262fea5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 20 Nov 2022 13:55:24 +0100 Subject: [PATCH] certinfo: replace uses of deprecated io/ioutil Signed-off-by: Sebastiaan van Stijn --- certinfo/certinfo.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/certinfo/certinfo.go b/certinfo/certinfo.go index 6c089a0a3..f658859cb 100644 --- a/certinfo/certinfo.go +++ b/certinfo/certinfo.go @@ -6,8 +6,8 @@ import ( "crypto/x509/pkix" "errors" "fmt" - "io/ioutil" "net" + "os" "strings" "time" @@ -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 @@ -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 } @@ -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 }