Skip to content

Commit

Permalink
use grpc.NewClient() instead of deprecated grpc.Dial()
Browse files Browse the repository at this point in the history
golangci-lint complains about the usage of the deprecated grpc.Dial()
function:

    SA1019: grpc.Dial is deprecated: use NewClient instead.

The grpc.NewClient() function seems to be completely compatible with
grpc.Dial(), parameters and return values are all the same.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
  • Loading branch information
nixpanic authored and mergify[bot] committed Apr 9, 2024
1 parent c93e781 commit aa241e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/csi-addons/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ type grpcClient struct {

// Connect to the endpoint, or panic in case it fails.
func (g *grpcClient) Connect(endpoint string) {
conn, err := grpc.Dial(
conn, err := grpc.NewClient(
endpoint,
grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func NewConnection(ctx context.Context, endpoint, nodeID, driverName, namespace,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithIdleTimeout(time.Duration(0)),
}
cc, err := grpc.Dial(endpoint, opts...)
cc, err := grpc.NewClient(endpoint, opts...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit aa241e2

Please sign in to comment.