[#1598] golangci: Enable unparam linter

To drop unnecessary parameters and return values.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2025-01-13 17:43:39 +03:00
parent 4d5ae59a52
commit fb928616cc
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0
26 changed files with 123 additions and 155 deletions

View file

@ -30,6 +30,8 @@ type InhumePrm struct {
// InhumeRes encapsulates results of inhume operation.
type InhumeRes struct{}
var inhumeRes = InhumeRes{}
// WithTarget sets a list of objects that should be inhumed and tombstone address
// as the reason for inhume operation.
//
@ -83,7 +85,7 @@ func (e *StorageEngine) Inhume(ctx context.Context, prm InhumePrm) (res InhumeRe
func (e *StorageEngine) inhume(ctx context.Context, prm InhumePrm) (InhumeRes, error) {
addrsPerShard, err := e.groupObjectsByShard(ctx, prm.addrs, !prm.forceRemoval)
if err != nil {
return InhumeRes{}, err
return inhumeRes, err
}
var shPrm shard.InhumePrm
@ -107,7 +109,7 @@ func (e *StorageEngine) inhume(ctx context.Context, prm InhumePrm) (InhumeRes, e
zap.String("shard_id", shardID),
zap.String("trace_id", tracingPkg.GetTraceID(ctx)),
)
return InhumeRes{}, errInhumeFailure
return inhumeRes, errInhumeFailure
}
if _, err := sh.Inhume(ctx, shPrm); err != nil {
@ -119,11 +121,11 @@ func (e *StorageEngine) inhume(ctx context.Context, prm InhumePrm) (InhumeRes, e
default:
e.reportShardError(ctx, sh, "couldn't inhume object in shard", err)
}
return InhumeRes{}, err
return inhumeRes, err
}
}
return InhumeRes{}, nil
return inhumeRes, nil
}
// groupObjectsByShard groups objects based on the shard(s) they are stored on.