diff --git a/pkg/local_object_storage/engine/exists.go b/pkg/local_object_storage/engine/exists.go index 537524efd..3127bf68e 100644 --- a/pkg/local_object_storage/engine/exists.go +++ b/pkg/local_object_storage/engine/exists.go @@ -24,7 +24,7 @@ func (e *StorageEngine) exists(addr oid.Address) (bool, error) { e.reportShardError(sh, "could not check existence of object in shard", err) } - if res != nil && !exists { + if !exists { exists = res.Exists() } diff --git a/pkg/local_object_storage/shard/container.go b/pkg/local_object_storage/shard/container.go index 27e4ea411..fc35a0a67 100644 --- a/pkg/local_object_storage/shard/container.go +++ b/pkg/local_object_storage/shard/container.go @@ -20,7 +20,7 @@ func (p *ContainerSizePrm) WithContainerID(cnr cid.ID) { } } -func (r *ContainerSizeRes) Size() uint64 { +func (r ContainerSizeRes) Size() uint64 { return r.size } diff --git a/pkg/local_object_storage/shard/dump.go b/pkg/local_object_storage/shard/dump.go index b27f47c14..170754c54 100644 --- a/pkg/local_object_storage/shard/dump.go +++ b/pkg/local_object_storage/shard/dump.go @@ -42,7 +42,7 @@ type DumpRes struct { } // Count return amount of object written. -func (r *DumpRes) Count() int { +func (r DumpRes) Count() int { return r.count } diff --git a/pkg/local_object_storage/shard/exists.go b/pkg/local_object_storage/shard/exists.go index 3ad35b9f7..4eef64716 100644 --- a/pkg/local_object_storage/shard/exists.go +++ b/pkg/local_object_storage/shard/exists.go @@ -27,7 +27,7 @@ func (p *ExistsPrm) WithAddress(addr oid.Address) *ExistsPrm { } // Exists returns the fact that the object is in the shard. -func (p *ExistsRes) Exists() bool { +func (p ExistsRes) Exists() bool { return p.ex } diff --git a/pkg/local_object_storage/shard/inhume.go b/pkg/local_object_storage/shard/inhume.go index 5063d2a30..9b7c25c80 100644 --- a/pkg/local_object_storage/shard/inhume.go +++ b/pkg/local_object_storage/shard/inhume.go @@ -75,5 +75,5 @@ func (s *Shard) Inhume(prm InhumePrm) (*InhumeRes, error) { return nil, fmt.Errorf("metabase inhume: %w", err) } - return new(InhumeRes), nil + return nil, nil } diff --git a/pkg/local_object_storage/shard/range.go b/pkg/local_object_storage/shard/range.go index 7c804f32d..dac65a209 100644 --- a/pkg/local_object_storage/shard/range.go +++ b/pkg/local_object_storage/shard/range.go @@ -49,12 +49,12 @@ func (p *RngPrm) WithIgnoreMeta(ignore bool) { // Object returns the requested object part. // // Instance payload contains the requested range of the original object. -func (r *RngRes) Object() *object.Object { +func (r RngRes) Object() *object.Object { return r.obj } // HasMeta returns true if info about the object was found in the metabase. -func (r *RngRes) HasMeta() bool { +func (r RngRes) HasMeta() bool { return r.hasMeta } diff --git a/pkg/local_object_storage/shard/restore.go b/pkg/local_object_storage/shard/restore.go index d714e1b43..62ba885f7 100644 --- a/pkg/local_object_storage/shard/restore.go +++ b/pkg/local_object_storage/shard/restore.go @@ -44,12 +44,12 @@ type RestoreRes struct { } // Count return amount of object written. -func (r *RestoreRes) Count() int { +func (r RestoreRes) Count() int { return r.count } // FailCount return amount of object skipped. -func (r *RestoreRes) FailCount() int { +func (r RestoreRes) FailCount() int { return r.failed } diff --git a/pkg/local_object_storage/shard/select.go b/pkg/local_object_storage/shard/select.go index 60dc48bef..b4800e818 100644 --- a/pkg/local_object_storage/shard/select.go +++ b/pkg/local_object_storage/shard/select.go @@ -35,7 +35,7 @@ func (p *SelectPrm) WithFilters(fs object.SearchFilters) { } // AddressList returns list of addresses of the selected objects. -func (r *SelectRes) AddressList() []oid.Address { +func (r SelectRes) AddressList() []oid.Address { return r.addrList }