From 516d7f392f988989e297568cd7bb48a0ef1b3fdf Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 25 Jun 2024 18:22:56 +0100 Subject: [PATCH] chore: grpc.Dial is deprecated: use NewClient instead --- examples/grpc/grpc_consumer_test.go | 6 +++--- internal/native/message_server_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/grpc/grpc_consumer_test.go b/examples/grpc/grpc_consumer_test.go index 44fdd8640..9efec964d 100644 --- a/examples/grpc/grpc_consumer_test.go +++ b/examples/grpc/grpc_consumer_test.go @@ -60,7 +60,7 @@ func TestGetFeatureSuccess(t *testing.T) { fmt.Println("gRPC transport running on", transport) // Establish the gRPC connection - conn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", transport.Port), grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(fmt.Sprintf("127.0.0.1:%d", transport.Port), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatal("unable to communicate to grpc server", err) } @@ -130,7 +130,7 @@ func TestGetFeatureError(t *testing.T) { fmt.Println("gRPC transport running on", transport) // Establish the gRPC connection - conn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", transport.Port), grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(fmt.Sprintf("127.0.0.1:%d", transport.Port), grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err) defer conn.Close() @@ -201,7 +201,7 @@ func TestSaveFeature(t *testing.T) { fmt.Println("gRPC transport running on", transport) // Establish the gRPC connection - conn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", transport.Port), grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(fmt.Sprintf("127.0.0.1:%d", transport.Port), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { t.Fatal("unable to communicate to grpc server", err) } diff --git a/internal/native/message_server_test.go b/internal/native/message_server_test.go index 3c39cb607..f1a18dad7 100644 --- a/internal/native/message_server_test.go +++ b/internal/native/message_server_test.go @@ -397,7 +397,7 @@ func TestGrpcPluginInteraction(t *testing.T) { } // Need to make a gRPC call here - conn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", port), grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(fmt.Sprintf("127.0.0.1:%d", port), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { l.Fatalf("did not connect: %v", err) } @@ -470,7 +470,7 @@ func TestGrpcPluginInteraction_ErrorResponse(t *testing.T) { } // Need to make a gRPC call here - conn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%d", port), grpc.WithTransportCredentials(insecure.NewCredentials())) + conn, err := grpc.NewClient(fmt.Sprintf("127.0.0.1:%d", port), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { l.Fatalf("did not connect: %v", err) }