From 24eb98889724f58338aeb0874b40de6db1f0cbc5 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Mon, 10 Jul 2023 12:18:56 +0300 Subject: [PATCH] [#294] deletesvc: Drop cast Signed-off-by: Dmitrii Stepanov --- pkg/services/object/delete/service.go | 6 +++--- pkg/services/object/delete/util.go | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pkg/services/object/delete/service.go b/pkg/services/object/delete/service.go index e208a298b..b74a4c7ba 100644 --- a/pkg/services/object/delete/service.go +++ b/pkg/services/object/delete/service.go @@ -72,9 +72,9 @@ func New(gs *getsvc.Service, opts ...Option) *Service { c := &cfg{ log: &logger.Logger{Logger: zap.L()}, - header: (*headSvcWrapper)(gs), - searcher: (*searchSvcWrapper)(ss), - placer: (*putSvcWrapper)(ps), + header: &headSvcWrapper{s: gs}, + searcher: &searchSvcWrapper{s: ss}, + placer: &putSvcWrapper{s: ps}, netInfo: ni, keyStorage: ks, } diff --git a/pkg/services/object/delete/util.go b/pkg/services/object/delete/util.go index b8e8e6324..439abca2b 100644 --- a/pkg/services/object/delete/util.go +++ b/pkg/services/object/delete/util.go @@ -11,11 +11,17 @@ import ( oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) -type headSvcWrapper getsvc.Service +type headSvcWrapper struct { + s *getsvc.Service +} -type searchSvcWrapper searchsvc.Service +type searchSvcWrapper struct { + s *searchsvc.Service +} -type putSvcWrapper putsvc.Service +type putSvcWrapper struct { + s *putsvc.Service +} type simpleIDWriter struct { ids []oid.ID @@ -30,7 +36,7 @@ func (w *headSvcWrapper) headAddress(ctx context.Context, exec *execCtx, addr oi p.WithRawFlag(true) p.WithAddress(addr) - err := (*getsvc.Service)(w).Head(ctx, p) + err := w.s.Head(ctx, p) if err != nil { return nil, err } @@ -94,7 +100,7 @@ func (w *searchSvcWrapper) splitMembers(ctx context.Context, exec *execCtx) ([]o p.WithContainerID(exec.containerID()) p.WithSearchFilters(fs) - err := (*searchsvc.Service)(w).Search(ctx, p) + err := w.s.Search(ctx, p) if err != nil { return nil, err } @@ -109,7 +115,7 @@ func (s *simpleIDWriter) WriteIDs(ids []oid.ID) error { } func (w *putSvcWrapper) put(ctx context.Context, exec *execCtx) (*oid.ID, error) { - streamer, err := (*putsvc.Service)(w).Put() + streamer, err := w.s.Put() if err != nil { return nil, err }