Move from deprecated ioutil to os and io packages
This commit is contained in:
parent
46c1600ada
commit
8d739c411b
4 changed files with 15 additions and 15 deletions
|
@ -224,8 +224,8 @@ So we modify the "gRPC server example" to use our own self-signed certificate:
|
|||
// ...
|
||||
|
||||
// Read cert and key file
|
||||
backendCert, _ := ioutil.ReadFile("./backend.cert")
|
||||
backendKey, _ := ioutil.ReadFile("./backend.key")
|
||||
backendCert, _ := os.ReadFile("./backend.cert")
|
||||
backendKey, _ := os.ReadFile("./backend.key")
|
||||
|
||||
// Generate Certificate struct
|
||||
cert, err := tls.X509KeyPair(backendCert, backendKey)
|
||||
|
@ -253,7 +253,7 @@ Next we will modify gRPC Client to use our Traefik self-signed certificate:
|
|||
// ...
|
||||
|
||||
// Read cert file
|
||||
frontendCert, _ := ioutil.ReadFile("./frontend.cert")
|
||||
frontendCert, _ := os.ReadFile("./frontend.cert")
|
||||
|
||||
// Create CertPool
|
||||
roots := x509.NewCertPool()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue