diff --git a/.golangci.yml b/.golangci.yml index fda26c2f5f..54a2261cbc 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -48,6 +48,7 @@ linters: - gofmt - goimports - misspell + - predeclared - reassign - whitespace disable-all: true diff --git a/pkg/innerring/processors/container/process_container.go b/pkg/innerring/processors/container/process_container.go index 0cb97ca20e..f4a3339889 100644 --- a/pkg/innerring/processors/container/process_container.go +++ b/pkg/innerring/processors/container/process_container.go @@ -127,13 +127,13 @@ func (cp *Processor) approvePutContainer(ctx *putContainerContext) { // Process delete container operation from the user by checking container sanity // and sending approve tx back to morph. -func (cp *Processor) processContainerDelete(delete *containerEvent.Delete) { +func (cp *Processor) processContainerDelete(e *containerEvent.Delete) { if !cp.alphabetState.IsAlphabet() { cp.log.Info("non alphabet mode, ignore container delete") return } - err := cp.checkDeleteContainer(delete) + err := cp.checkDeleteContainer(e) if err != nil { cp.log.Error("delete container check failed", zap.String("error", err.Error()), @@ -142,7 +142,7 @@ func (cp *Processor) processContainerDelete(delete *containerEvent.Delete) { return } - cp.approveDeleteContainer(delete) + cp.approveDeleteContainer(e) } func (cp *Processor) checkDeleteContainer(e *containerEvent.Delete) error { diff --git a/pkg/services/audit/taskmanager/manager.go b/pkg/services/audit/taskmanager/manager.go index 44b14c3fed..081939e7d8 100644 --- a/pkg/services/audit/taskmanager/manager.go +++ b/pkg/services/audit/taskmanager/manager.go @@ -68,9 +68,9 @@ func WithWorkerPool(p util.WorkerPool) Option { } // WithQueueCapacity returns option to set task queue capacity. -func WithQueueCapacity(cap uint32) Option { +func WithQueueCapacity(capacity uint32) Option { return func(c *cfg) { - c.queueCap = cap + c.queueCap = capacity } } diff --git a/pkg/services/object_manager/transformer/transformer.go b/pkg/services/object_manager/transformer/transformer.go index 159f76c266..274496e5d7 100644 --- a/pkg/services/object_manager/transformer/transformer.go +++ b/pkg/services/object_manager/transformer/transformer.go @@ -174,11 +174,11 @@ func payloadHashersForObject(obj *object.Object, withoutHomomorphicHash bool) [] return hashers } -func (s *payloadSizeLimiter) release(close bool) (*AccessIdentifiers, error) { - // Arg close is true only from Close method. +func (s *payloadSizeLimiter) release(finalize bool) (*AccessIdentifiers, error) { + // Arg finalize is true only when called from Close method. // We finalize parent and generate linking objects only if it is more // than 1 object in split-chain. - withParent := close && len(s.previous) > 0 + withParent := finalize && len(s.previous) > 0 if withParent { writeHashes(s.parentHashers) diff --git a/pkg/services/policer/policer.go b/pkg/services/policer/policer.go index ed0a2f8bf1..32dfce4c47 100644 --- a/pkg/services/policer/policer.go +++ b/pkg/services/policer/policer.go @@ -196,9 +196,9 @@ func WithRedundantCopyCallback(cb RedundantCopyCallback) Option { // WithMaxCapacity returns option to set max capacity // that can be set to the pool. -func WithMaxCapacity(cap int) Option { +func WithMaxCapacity(capacity int) Option { return func(c *cfg) { - c.maxCapacity = cap + c.maxCapacity = capacity } }