[#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:
parent
faec499b38
commit
c274bbeb7c
2 changed files with 23 additions and 23 deletions
|
@ -90,48 +90,48 @@ func (s *Service) get(ctx context.Context, prm RequestParameters) error {
|
|||
return exec.err
|
||||
}
|
||||
|
||||
func (exec *request) execute(ctx context.Context) {
|
||||
exec.log.Debug(ctx, logs.ServingRequest)
|
||||
func (r *request) execute(ctx context.Context) {
|
||||
r.log.Debug(ctx, logs.ServingRequest)
|
||||
|
||||
// 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
|
||||
switch exec.status {
|
||||
switch r.status {
|
||||
case statusOK:
|
||||
exec.log.Debug(ctx, logs.OperationFinishedSuccessfully)
|
||||
r.log.Debug(ctx, logs.OperationFinishedSuccessfully)
|
||||
case statusINHUMED:
|
||||
exec.log.Debug(ctx, logs.GetRequestedObjectWasMarkedAsRemoved)
|
||||
r.log.Debug(ctx, logs.GetRequestedObjectWasMarkedAsRemoved)
|
||||
case statusVIRTUAL:
|
||||
exec.log.Debug(ctx, logs.GetRequestedObjectIsVirtual)
|
||||
exec.assemble(ctx)
|
||||
r.log.Debug(ctx, logs.GetRequestedObjectIsVirtual)
|
||||
r.assemble(ctx)
|
||||
case statusOutOfRange:
|
||||
exec.log.Debug(ctx, logs.GetRequestedRangeIsOutOfObjectBounds)
|
||||
r.log.Debug(ctx, logs.GetRequestedRangeIsOutOfObjectBounds)
|
||||
case statusEC:
|
||||
exec.log.Debug(ctx, logs.GetRequestedObjectIsEC)
|
||||
if exec.isRaw() && execCnr {
|
||||
exec.executeOnContainer(ctx)
|
||||
exec.analyzeStatus(ctx, false)
|
||||
r.log.Debug(ctx, logs.GetRequestedObjectIsEC)
|
||||
if r.isRaw() && execCnr {
|
||||
r.executeOnContainer(ctx)
|
||||
r.analyzeStatus(ctx, false)
|
||||
}
|
||||
exec.assembleEC(ctx)
|
||||
r.assembleEC(ctx)
|
||||
default:
|
||||
exec.log.Debug(ctx, logs.OperationFinishedWithError,
|
||||
zap.Error(exec.err),
|
||||
r.log.Debug(ctx, logs.OperationFinishedWithError,
|
||||
zap.Error(r.err),
|
||||
)
|
||||
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
|
||||
// write to the output stream. So there is no need to try to find object on other nodes.
|
||||
return
|
||||
}
|
||||
|
||||
if execCnr {
|
||||
exec.executeOnContainer(ctx)
|
||||
exec.analyzeStatus(ctx, false)
|
||||
r.executeOnContainer(ctx)
|
||||
r.analyzeStatus(ctx, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,8 +56,8 @@ func NewService(ks *objutil.KeyStorage,
|
|||
}
|
||||
}
|
||||
|
||||
func (p *Service) Put() (*Streamer, error) {
|
||||
func (s *Service) Put() (*Streamer, error) {
|
||||
return &Streamer{
|
||||
Config: p.Config,
|
||||
Config: s.Config,
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue