diff --git a/.golangci.yml b/.golangci.yml index 4c4fccc9b..f4eed767d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -53,5 +53,6 @@ linters: - predeclared - reassign - whitespace + - containedctx disable-all: true fast: false diff --git a/cmd/frostfs-node/config.go b/cmd/frostfs-node/config.go index 3aabb63df..b2b122412 100644 --- a/cmd/frostfs-node/config.go +++ b/cmd/frostfs-node/config.go @@ -297,6 +297,7 @@ func (a *applicationConfiguration) readConfig(c *config.Config) error { // the application life cycle. // It should not contain any read configuration values, component-specific // helpers and fields. +// nolint: containedctx type internals struct { ctx context.Context ctxCancel func() diff --git a/cmd/frostfs-node/container.go b/cmd/frostfs-node/container.go index bfa555db3..ac0499226 100644 --- a/cmd/frostfs-node/container.go +++ b/cmd/frostfs-node/container.go @@ -363,6 +363,7 @@ func (p *remoteLoadAnnounceWriterProvider) InitWriter(ctx context.Context) (load }, nil } +// nolint: containedctx type remoteLoadAnnounceWriter struct { ctx context.Context diff --git a/cmd/frostfs-node/reputation/common/util.go b/cmd/frostfs-node/reputation/common/util.go index c0a5cbc7b..28351d0ce 100644 --- a/cmd/frostfs-node/reputation/common/util.go +++ b/cmd/frostfs-node/reputation/common/util.go @@ -8,6 +8,7 @@ import ( ) // EpochContext is a std context extended with epoch data. +// nolint: containedctx type EpochContext struct { context.Context E uint64 diff --git a/cmd/frostfs-node/reputation/internal/client/client.go b/cmd/frostfs-node/reputation/internal/client/client.go index 79bc3d44f..22fd21d4a 100644 --- a/cmd/frostfs-node/reputation/internal/client/client.go +++ b/cmd/frostfs-node/reputation/internal/client/client.go @@ -9,6 +9,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/reputation" ) +// nolint: containedctx type commonPrm struct { cli coreclient.Client diff --git a/pkg/core/storagegroup/storagegroup.go b/pkg/core/storagegroup/storagegroup.go index 6474377bb..f4e584134 100644 --- a/pkg/core/storagegroup/storagegroup.go +++ b/pkg/core/storagegroup/storagegroup.go @@ -11,6 +11,7 @@ import ( ) // SearchSGPrm groups the parameters which are formed by Processor to search the storage group objects. +// nolint: containedctx type SearchSGPrm struct { Context context.Context @@ -25,6 +26,7 @@ type SearchSGDst struct { } // GetSGPrm groups parameter of GetSG operation. +// nolint: containedctx type GetSGPrm struct { Context context.Context diff --git a/pkg/innerring/internal/client/prm.go b/pkg/innerring/internal/client/prm.go index 3c749fe61..5498eb379 100644 --- a/pkg/innerring/internal/client/prm.go +++ b/pkg/innerring/internal/client/prm.go @@ -6,6 +6,7 @@ import ( oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) +// nolint: containedctx type contextPrm struct { ctx context.Context } diff --git a/pkg/morph/client/constructor.go b/pkg/morph/client/constructor.go index 01fd30f70..efb3d0bfd 100644 --- a/pkg/morph/client/constructor.go +++ b/pkg/morph/client/constructor.go @@ -26,6 +26,7 @@ type Option func(*cfg) type Callback func() // groups the configurations with default values. +// nolint: containedctx type cfg struct { ctx context.Context // neo-go client context diff --git a/pkg/services/audit/auditor/context.go b/pkg/services/audit/auditor/context.go index 528a3bbb5..4a5cbb457 100644 --- a/pkg/services/audit/auditor/context.go +++ b/pkg/services/audit/auditor/context.go @@ -81,6 +81,7 @@ type ContextPrm struct { pdpWorkerPool, porWorkerPool util.WorkerPool } +// nolint: containedctx type commonCommunicatorPrm struct { Context context.Context diff --git a/pkg/services/audit/task.go b/pkg/services/audit/task.go index 554aab6c4..35932a69e 100644 --- a/pkg/services/audit/task.go +++ b/pkg/services/audit/task.go @@ -10,6 +10,7 @@ import ( ) // Task groups groups the container audit parameters. +// nolint: containedctx type Task struct { reporter Reporter diff --git a/pkg/services/container/announcement/load/controller/calls.go b/pkg/services/container/announcement/load/controller/calls.go index 54eb7e07c..c6b574c32 100644 --- a/pkg/services/container/announcement/load/controller/calls.go +++ b/pkg/services/container/announcement/load/controller/calls.go @@ -15,6 +15,7 @@ type StartPrm struct { Epoch uint64 } +// nolint: containedctx type commonContext struct { epoch uint64 diff --git a/pkg/services/container/announcement/load/route/calls.go b/pkg/services/container/announcement/load/route/calls.go index 989120b40..95099fd5a 100644 --- a/pkg/services/container/announcement/load/route/calls.go +++ b/pkg/services/container/announcement/load/route/calls.go @@ -10,6 +10,7 @@ import ( "go.uber.org/zap" ) +// nolint: containedctx type routeContext struct { context.Context diff --git a/pkg/services/object/delete/exec.go b/pkg/services/object/delete/exec.go index 112796f27..4da4c8083 100644 --- a/pkg/services/object/delete/exec.go +++ b/pkg/services/object/delete/exec.go @@ -18,6 +18,7 @@ type statusError struct { err error } +// nolint: containedctx type execCtx struct { svc *Service diff --git a/pkg/services/object/get/exec.go b/pkg/services/object/get/exec.go index 09ff9a82f..9858b32b2 100644 --- a/pkg/services/object/get/exec.go +++ b/pkg/services/object/get/exec.go @@ -19,6 +19,7 @@ type statusError struct { err error } +// nolint: containedctx type execCtx struct { svc *Service diff --git a/pkg/services/object/internal/client/client.go b/pkg/services/object/internal/client/client.go index 8f2483bc0..ee6777a5d 100644 --- a/pkg/services/object/internal/client/client.go +++ b/pkg/services/object/internal/client/client.go @@ -18,6 +18,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" ) +// nolint: containedctx type commonPrm struct { cli coreclient.Client diff --git a/pkg/services/object/put/remote.go b/pkg/services/object/put/remote.go index 0f0dc355a..760de7508 100644 --- a/pkg/services/object/put/remote.go +++ b/pkg/services/object/put/remote.go @@ -15,6 +15,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" ) +// nolint: containedctx type remoteTarget struct { ctx context.Context diff --git a/pkg/services/object/put/streamer.go b/pkg/services/object/put/streamer.go index ae1a2f451..8ca90e86f 100644 --- a/pkg/services/object/put/streamer.go +++ b/pkg/services/object/put/streamer.go @@ -16,6 +16,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" ) +// nolint: containedctx type Streamer struct { *cfg diff --git a/pkg/services/object/search/exec.go b/pkg/services/object/search/exec.go index 18700b254..a1737b521 100644 --- a/pkg/services/object/search/exec.go +++ b/pkg/services/object/search/exec.go @@ -16,6 +16,7 @@ type statusError struct { err error } +// nolint: containedctx type execCtx struct { svc *Service diff --git a/pkg/services/policer/check.go b/pkg/services/policer/check.go index 1da07f45d..e240bbea7 100644 --- a/pkg/services/policer/check.go +++ b/pkg/services/policer/check.go @@ -136,6 +136,7 @@ func (p *Policer) processObject(ctx context.Context, addrWithType objectcore.Add } } +// nolint: containedctx type processPlacementContext struct { context.Context diff --git a/pkg/services/reputation/eigentrust/controller/calls.go b/pkg/services/reputation/eigentrust/controller/calls.go index 87d23c7f2..28228706c 100644 --- a/pkg/services/reputation/eigentrust/controller/calls.go +++ b/pkg/services/reputation/eigentrust/controller/calls.go @@ -12,6 +12,7 @@ type ContinuePrm struct { Epoch uint64 } +// nolint: containedctx type iterContext struct { context.Context diff --git a/pkg/services/reputation/eigentrust/iteration.go b/pkg/services/reputation/eigentrust/iteration.go index 90a214ebc..b06064f78 100644 --- a/pkg/services/reputation/eigentrust/iteration.go +++ b/pkg/services/reputation/eigentrust/iteration.go @@ -38,6 +38,7 @@ type IterationTrust struct { // IterContext aggregates context and data required for // iterations. +// nolint: containedctx type IterContext struct { context.Context EpochIteration diff --git a/pkg/services/reputation/local/controller/calls.go b/pkg/services/reputation/local/controller/calls.go index d4e122b0e..98815492c 100644 --- a/pkg/services/reputation/local/controller/calls.go +++ b/pkg/services/reputation/local/controller/calls.go @@ -51,6 +51,7 @@ type reportContext struct { ctx common.Context } +// nolint: containedctx type iteratorContext struct { context.Context