Skip to content

Commit 26acb46

Browse files
committed
sdk: Change Deprecated method when creating new Connection GRPC
reference: https://github.com/grpc/grpc-go/blob/v1.73.0/clientconn.go#L145
1 parent 13be417 commit 26acb46

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cmd/candi/template_sdk.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ import (
6666
6767
"google.golang.org/grpc"
6868
"google.golang.org/grpc/backoff"
69+
"google.golang.org/grpc/credentials/insecure"
6970
)
7071
7172
type {{lower (clean $.ServiceName)}}GRPCImpl struct {
@@ -80,7 +81,7 @@ func New{{upper (clean $.ServiceName)}}ServiceGRPC(host string, authKey string)
8081
if u, _ := url.Parse(host); u.Host != "" {
8182
host = u.Host
8283
}
83-
conn, err := grpc.Dial(host, grpc.WithInsecure(), grpc.WithConnectParams(grpc.ConnectParams{
84+
conn, err := grpc.NewClient(host, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithConnectParams(grpc.ConnectParams{
8485
Backoff: backoff.Config{
8586
BaseDelay: 50 * time.Millisecond,
8687
Multiplier: 5,

0 commit comments

Comments
 (0)