Skip to content

Commit

Permalink
Merge pull request #161 from testwill/ioutil
Browse files Browse the repository at this point in the history
chore: remove refs to deprecated io/ioutil
  • Loading branch information
hslatman authored Nov 30, 2023
2 parents 67d1305 + 6754df6 commit 898301b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions examples/hello-mtls/go-grpc/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"sync"
Expand Down Expand Up @@ -55,7 +54,7 @@ func (r *rotator) loadCertificate(certFile, keyFile string) error {
}

func loadRootCertPool() (*x509.CertPool, error) {
root, err := ioutil.ReadFile(autocertRoot)
root, err := os.ReadFile(autocertRoot)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-mtls/go-grpc/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"log"
"net"
"os"
"sync"
"time"

Expand Down Expand Up @@ -55,7 +55,7 @@ func (r *rotator) loadCertificate(certFile, keyFile string) error {
}

func loadRootCertPool() (*x509.CertPool, error) {
root, err := ioutil.ReadFile(autocertRoot)
root, err := os.ReadFile(autocertRoot)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions examples/hello-mtls/go/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"io"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -48,7 +48,7 @@ func (r *rotator) loadCertificate(certFile, keyFile string) error {
}

func loadRootCertPool() (*x509.CertPool, error) {
root, err := ioutil.ReadFile(autocertRoot)
root, err := os.ReadFile(autocertRoot)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -130,7 +130,7 @@ func main() {
}

defer r.Body.Close()
body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
if err != nil {
log.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions examples/hello-mtls/go/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"net/http"
"sync"
"time"
Expand Down Expand Up @@ -48,7 +48,7 @@ func (r *rotator) loadCertificate(certFile, keyFile string) error {
}

func loadRootCertPool() (*x509.CertPool, error) {
root, err := ioutil.ReadFile(autocertRoot)
root, err := os.ReadFile(autocertRoot)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 898301b

Please sign in to comment.