From f602d05b0ac87f4c9bafe62ffd67842d13171cdd Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 8 Jun 2022 11:36:50 +0300 Subject: [PATCH] [#1494] *: Fix linter warnings Signed-off-by: Evgenii Stratonikov --- cmd/neofs-node/cache.go | 4 ---- cmd/neofs-node/object.go | 11 ----------- pkg/local_object_storage/engine/select.go | 12 ++++++------ pkg/morph/client/audit/put_result.go | 3 --- pkg/morph/client/container/client.go | 1 - 5 files changed, 6 insertions(+), 25 deletions(-) diff --git a/cmd/neofs-node/cache.go b/cmd/neofs-node/cache.go index 7a5ddff90..84952465a 100644 --- a/cmd/neofs-node/cache.go +++ b/cmd/neofs-node/cache.go @@ -82,10 +82,6 @@ func (c *ttlNetCache) remove(key interface{}) { c.cache.Remove(key) } -func (c *ttlNetCache) keys() []interface{} { - return c.cache.Keys() -} - // entity that provides LRU cache interface. type lruNetCache struct { cache *lru.Cache diff --git a/cmd/neofs-node/object.go b/cmd/neofs-node/object.go index 6a65d9ab4..cad4baf2e 100644 --- a/cmd/neofs-node/object.go +++ b/cmd/neofs-node/object.go @@ -404,17 +404,6 @@ type morphEACLFetcher struct { w *cntClient.Client } -type signedEACLTable eaclSDK.Table - -func (s *signedEACLTable) ReadSignedData(_ []byte) ([]byte, error) { - return (*eaclSDK.Table)(s).Marshal() -} - -func (s *signedEACLTable) SignedDataSize() int { - // TODO: #1147 add eacl.Table.Size method - return (*eaclSDK.Table)(s).ToV2().StableSize() -} - func (s *morphEACLFetcher) GetEACL(cnr cid.ID) (*eaclSDK.Table, error) { table, err := s.w.GetEACL(cnr) if err != nil { diff --git a/pkg/local_object_storage/engine/select.go b/pkg/local_object_storage/engine/select.go index 5ea698ba9..8142e300b 100644 --- a/pkg/local_object_storage/engine/select.go +++ b/pkg/local_object_storage/engine/select.go @@ -70,12 +70,12 @@ func (e *StorageEngine) _select(prm SelectPrm) (SelectRes, error) { if err != nil { e.reportShardError(sh, "could not select objects from shard", err) return false - } else { - for _, addr := range res.AddressList() { // save only unique values - if _, ok := uniqueMap[addr.EncodeToString()]; !ok { - uniqueMap[addr.EncodeToString()] = struct{}{} - addrList = append(addrList, addr) - } + } + + for _, addr := range res.AddressList() { // save only unique values + if _, ok := uniqueMap[addr.EncodeToString()]; !ok { + uniqueMap[addr.EncodeToString()] = struct{}{} + addrList = append(addrList, addr) } } diff --git a/pkg/morph/client/audit/put_result.go b/pkg/morph/client/audit/put_result.go index d55c434e0..71181c46f 100644 --- a/pkg/morph/client/audit/put_result.go +++ b/pkg/morph/client/audit/put_result.go @@ -1,7 +1,6 @@ package audit import ( - "errors" "fmt" "github.com/nspcc-dev/neofs-node/pkg/morph/client" @@ -11,8 +10,6 @@ import ( // ResultID is an identity of audit result inside audit contract. type ResultID []byte -var errUnsupported = errors.New("unsupported structure version") - // PutPrm groups parameters of PutAuditResult operation. type PutPrm struct { result *auditAPI.Result diff --git a/pkg/morph/client/container/client.go b/pkg/morph/client/container/client.go index 494edf74c..438505d9a 100644 --- a/pkg/morph/client/container/client.go +++ b/pkg/morph/client/container/client.go @@ -42,7 +42,6 @@ const ( var ( errNilArgument = errors.New("empty argument") - errUnsupported = errors.New("unsupported structure version") ) // NewFromMorph returns the wrapper instance from the raw morph client.