From 4cd755877c14e2d26525240fccaee39e1afb50d8 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 7 Apr 2023 08:28:53 +0300 Subject: [PATCH] [#47] client: Do not check context in NetmapSnapshot() It is passed explicitly, non-nil by convention. Signed-off-by: Evgenii Stratonikov --- client/netmap.go | 5 ----- client/netmap_test.go | 5 ----- 2 files changed, 10 deletions(-) diff --git a/client/netmap.go b/client/netmap.go index 2eafcff..a4abb0b 100644 --- a/client/netmap.go +++ b/client/netmap.go @@ -233,11 +233,6 @@ func (x ResNetMapSnapshot) NetMap() netmap.NetMap { // Return statuses: // - global (see Client docs). func (c *Client) NetMapSnapshot(ctx context.Context, _ PrmNetMapSnapshot) (*ResNetMapSnapshot, error) { - // check context - if ctx == nil { - return nil, errorMissingContext - } - // form request body var body v2netmap.SnapshotRequestBody diff --git a/client/netmap_test.go b/client/netmap_test.go index 0548245..76920a1 100644 --- a/client/netmap_test.go +++ b/client/netmap_test.go @@ -69,11 +69,6 @@ func TestClient_NetMapSnapshot(t *testing.T) { c := newClient(&srv) ctx := context.Background() - // missing context - //nolint:staticcheck - _, err = c.NetMapSnapshot(nil, prm) - require.ErrorIs(t, err, errorMissingContext, "") - // request signature srv.errTransport = errors.New("any error")