From a4900dafbfe7cc327136ab3050313e4aee892c6e Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 27 Feb 2024 13:28:17 +0400 Subject: [PATCH] cli: Do not unwrap dial errors manually `status.Code` function supports wrapped errors, so it's redundant to do `errors.Unwrap` before. Signed-off-by: Leonard Lyubich --- cmd/neofs-cli/internal/client/sdk.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/neofs-cli/internal/client/sdk.go b/cmd/neofs-cli/internal/client/sdk.go index 348e49c0fa7..efcb5a48724 100644 --- a/cmd/neofs-cli/internal/client/sdk.go +++ b/cmd/neofs-cli/internal/client/sdk.go @@ -74,11 +74,7 @@ func GetSDKClient(ctx context.Context, addr network.Address) (*client.Client, er // This behavior is going to be fixed on SDK side. // // Track https://github.com/nspcc-dev/neofs-node/issues/2477 - wErr := err - for e := errors.Unwrap(wErr); e != nil; e = errors.Unwrap(wErr) { - wErr = e - } - if status.Code(wErr) == codes.Unimplemented { + if status.Code(err) == codes.Unimplemented { return c, nil } return nil, fmt.Errorf("can't init SDK client: %w", err)