[#1689] linter: Fix staticcheck warning: 'methods on the same type should have the same receiver name'

Change-Id: I25e9432987f73061c1506a184a82065e37885861
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2025-04-07 17:25:59 +03:00
parent faec499b38
commit c274bbeb7c
Signed by: achuprov
GPG key ID: 2D916FFD803B0EDD
2 changed files with 23 additions and 23 deletions

View file

@ -90,48 +90,48 @@ func (s *Service) get(ctx context.Context, prm RequestParameters) error {
return exec.err return exec.err
} }
func (exec *request) execute(ctx context.Context) { func (r *request) execute(ctx context.Context) {
exec.log.Debug(ctx, logs.ServingRequest) r.log.Debug(ctx, logs.ServingRequest)
// perform local operation // perform local operation
exec.executeLocal(ctx) r.executeLocal(ctx)
exec.analyzeStatus(ctx, true) r.analyzeStatus(ctx, true)
} }
func (exec *request) analyzeStatus(ctx context.Context, execCnr bool) { func (r *request) analyzeStatus(ctx context.Context, execCnr bool) {
// analyze local result // analyze local result
switch exec.status { switch r.status {
case statusOK: case statusOK:
exec.log.Debug(ctx, logs.OperationFinishedSuccessfully) r.log.Debug(ctx, logs.OperationFinishedSuccessfully)
case statusINHUMED: case statusINHUMED:
exec.log.Debug(ctx, logs.GetRequestedObjectWasMarkedAsRemoved) r.log.Debug(ctx, logs.GetRequestedObjectWasMarkedAsRemoved)
case statusVIRTUAL: case statusVIRTUAL:
exec.log.Debug(ctx, logs.GetRequestedObjectIsVirtual) r.log.Debug(ctx, logs.GetRequestedObjectIsVirtual)
exec.assemble(ctx) r.assemble(ctx)
case statusOutOfRange: case statusOutOfRange:
exec.log.Debug(ctx, logs.GetRequestedRangeIsOutOfObjectBounds) r.log.Debug(ctx, logs.GetRequestedRangeIsOutOfObjectBounds)
case statusEC: case statusEC:
exec.log.Debug(ctx, logs.GetRequestedObjectIsEC) r.log.Debug(ctx, logs.GetRequestedObjectIsEC)
if exec.isRaw() && execCnr { if r.isRaw() && execCnr {
exec.executeOnContainer(ctx) r.executeOnContainer(ctx)
exec.analyzeStatus(ctx, false) r.analyzeStatus(ctx, false)
} }
exec.assembleEC(ctx) r.assembleEC(ctx)
default: default:
exec.log.Debug(ctx, logs.OperationFinishedWithError, r.log.Debug(ctx, logs.OperationFinishedWithError,
zap.Error(exec.err), zap.Error(r.err),
) )
var errAccessDenied *apistatus.ObjectAccessDenied var errAccessDenied *apistatus.ObjectAccessDenied
if execCnr && errors.As(exec.err, &errAccessDenied) { if execCnr && errors.As(r.err, &errAccessDenied) {
// Local get can't return access denied error, so this error was returned by // Local get can't return access denied error, so this error was returned by
// write to the output stream. So there is no need to try to find object on other nodes. // write to the output stream. So there is no need to try to find object on other nodes.
return return
} }
if execCnr { if execCnr {
exec.executeOnContainer(ctx) r.executeOnContainer(ctx)
exec.analyzeStatus(ctx, false) r.analyzeStatus(ctx, false)
} }
} }
} }

View file

@ -56,8 +56,8 @@ func NewService(ks *objutil.KeyStorage,
} }
} }
func (p *Service) Put() (*Streamer, error) { func (s *Service) Put() (*Streamer, error) {
return &Streamer{ return &Streamer{
Config: p.Config, Config: s.Config,
}, nil }, nil
} }