forked from TrueCloudLab/frostfs-node
[#148] linter: Add containedctx linter
Context has to be passed as an argument: https://pkg.go.dev/context Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
2dc86058c3
commit
cc8ff015b4
22 changed files with 23 additions and 0 deletions
|
@ -53,5 +53,6 @@ linters:
|
|||
- predeclared
|
||||
- reassign
|
||||
- whitespace
|
||||
- containedctx
|
||||
disable-all: true
|
||||
fast: false
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -363,6 +363,7 @@ func (p *remoteLoadAnnounceWriterProvider) InitWriter(ctx context.Context) (load
|
|||
}, nil
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type remoteLoadAnnounceWriter struct {
|
||||
ctx context.Context
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
)
|
||||
|
||||
// EpochContext is a std context extended with epoch data.
|
||||
// nolint: containedctx
|
||||
type EpochContext struct {
|
||||
context.Context
|
||||
E uint64
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/reputation"
|
||||
)
|
||||
|
||||
// nolint: containedctx
|
||||
type commonPrm struct {
|
||||
cli coreclient.Client
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||
)
|
||||
|
||||
// nolint: containedctx
|
||||
type contextPrm struct {
|
||||
ctx context.Context
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -81,6 +81,7 @@ type ContextPrm struct {
|
|||
pdpWorkerPool, porWorkerPool util.WorkerPool
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type commonCommunicatorPrm struct {
|
||||
Context context.Context
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
)
|
||||
|
||||
// Task groups groups the container audit parameters.
|
||||
// nolint: containedctx
|
||||
type Task struct {
|
||||
reporter Reporter
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ type StartPrm struct {
|
|||
Epoch uint64
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type commonContext struct {
|
||||
epoch uint64
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
// nolint: containedctx
|
||||
type routeContext struct {
|
||||
context.Context
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ type statusError struct {
|
|||
err error
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type execCtx struct {
|
||||
svc *Service
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ type statusError struct {
|
|||
err error
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type execCtx struct {
|
||||
svc *Service
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session"
|
||||
)
|
||||
|
||||
// nolint: containedctx
|
||||
type commonPrm struct {
|
||||
cli coreclient.Client
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
||||
)
|
||||
|
||||
// nolint: containedctx
|
||||
type remoteTarget struct {
|
||||
ctx context.Context
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
|
||||
)
|
||||
|
||||
// nolint: containedctx
|
||||
type Streamer struct {
|
||||
*cfg
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ type statusError struct {
|
|||
err error
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type execCtx struct {
|
||||
svc *Service
|
||||
|
||||
|
|
|
@ -136,6 +136,7 @@ func (p *Policer) processObject(ctx context.Context, addrWithType objectcore.Add
|
|||
}
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type processPlacementContext struct {
|
||||
context.Context
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ type ContinuePrm struct {
|
|||
Epoch uint64
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type iterContext struct {
|
||||
context.Context
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ type IterationTrust struct {
|
|||
|
||||
// IterContext aggregates context and data required for
|
||||
// iterations.
|
||||
// nolint: containedctx
|
||||
type IterContext struct {
|
||||
context.Context
|
||||
EpochIteration
|
||||
|
|
|
@ -51,6 +51,7 @@ type reportContext struct {
|
|||
ctx common.Context
|
||||
}
|
||||
|
||||
// nolint: containedctx
|
||||
type iteratorContext struct {
|
||||
context.Context
|
||||
|
||||
|
|
Loading…
Reference in a new issue