Skip to content

Commit

Permalink
chore: grpc.Dial is deprecated: use NewClient instead
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Jun 25, 2024
1 parent 4036154 commit 516d7f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/grpc/grpc_consumer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/native/message_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 516d7f3

Please sign in to comment.