Skip to content

Commit 43a6251

Browse files
jholdstockjrick
authored andcommitted
grpc_example: Don't use deprecated grpc.Dial func
1 parent f8c768c commit 43a6251

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rpc/documentation/clientusage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func main() {
8989
Certificates: []tls.Certificate{keypair},
9090
RootCAs: serverCAs,
9191
})
92-
conn, err := grpc.Dial("localhost:19111", grpc.WithTransportCredentials(creds))
92+
conn, err := grpc.NewClient("localhost:19111", grpc.WithTransportCredentials(creds))
9393
if err != nil {
9494
fmt.Println(err)
9595
return

rpc/grpc_example/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func run() error {
4444
return err
4545
}
4646
if !serverCAs.AppendCertsFromPEM(serverCert) {
47-
return fmt.Errorf("no certificates found in %s\n", certificateFile)
47+
return fmt.Errorf("no certificates found in %s", certificateFile)
4848
}
4949
keypair, err := tls.LoadX509KeyPair(walletClientCertFile, walletClientKeyFile)
5050
if err != nil {
@@ -54,7 +54,7 @@ func run() error {
5454
Certificates: []tls.Certificate{keypair},
5555
RootCAs: serverCAs,
5656
})
57-
conn, err := grpc.Dial("localhost:19111", grpc.WithTransportCredentials(creds))
57+
conn, err := grpc.NewClient("localhost:19111", grpc.WithTransportCredentials(creds))
5858
if err != nil {
5959
return err
6060
}

0 commit comments

Comments
 (0)