Skip to content

Commit

Permalink
Replacing deprecated methofs
Browse files Browse the repository at this point in the history
Signed-off-by: alanprot <[email protected]>
  • Loading branch information
alanprot committed Nov 29, 2024
1 parent 3b027af commit 7fa8414
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion httpgrpc/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func NewClient(address string) (*Client, error) {
),
}

conn, err := grpc.Dial(address, dialOptions...)
conn, err := grpc.NewClient(address, dialOptions...)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions middleware/grpc_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestGrpcStats(t *testing.T) {
grpc_health_v1.RegisterHealthServer(serv, health.NewServer())

closed := false
conn, err := grpc.Dial(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
defer func() {
if !closed {
Expand Down Expand Up @@ -149,7 +149,7 @@ func TestGrpcStatsStreaming(t *testing.T) {

middleware_test.RegisterEchoServerServer(serv, &halfEcho{log: t.Log})

conn, err := grpc.Dial(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(10e6), grpc.MaxCallSendMsgSize(10e6)))
conn, err := grpc.NewClient(listener.Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(10e6), grpc.MaxCallSendMsgSize(10e6)))
require.NoError(t, err)
defer func() {
require.NoError(t, conn.Close())
Expand Down
6 changes: 3 additions & 3 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TestDefaultAddresses(t *testing.T) {
go server.Run() //nolint:errcheck
defer server.Shutdown()

conn, err := grpc.Dial("localhost:9095", grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient("localhost:9095", grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
defer conn.Close() //nolint:errcheck

Expand Down Expand Up @@ -169,7 +169,7 @@ func TestErrorInstrumentationMiddleware(t *testing.T) {

go server.Run() //nolint:errcheck

conn, err := grpc.Dial("localhost:1234", grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient("localhost:1234", grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
defer conn.Close() //nolint:errcheck

Expand Down Expand Up @@ -583,7 +583,7 @@ func TestTLSServer(t *testing.T) {
expected := []byte("Hello World!")
require.Equal(t, expected, body)

conn, err := grpc.Dial("localhost:9194", grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig)))
conn, err := grpc.NewClient("localhost:9194", grpc.WithTransportCredentials(credentials.NewTLS(tlsConfig)))
require.NoError(t, err)
defer conn.Close() //nolint:errcheck

Expand Down

0 comments on commit 7fa8414

Please sign in to comment.