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
|
- predeclared
|
||||||
- reassign
|
- reassign
|
||||||
- whitespace
|
- whitespace
|
||||||
|
- containedctx
|
||||||
disable-all: true
|
disable-all: true
|
||||||
fast: false
|
fast: false
|
||||||
|
|
|
@ -297,6 +297,7 @@ func (a *applicationConfiguration) readConfig(c *config.Config) error {
|
||||||
// the application life cycle.
|
// the application life cycle.
|
||||||
// It should not contain any read configuration values, component-specific
|
// It should not contain any read configuration values, component-specific
|
||||||
// helpers and fields.
|
// helpers and fields.
|
||||||
|
// nolint: containedctx
|
||||||
type internals struct {
|
type internals struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
ctxCancel func()
|
ctxCancel func()
|
||||||
|
|
|
@ -363,6 +363,7 @@ func (p *remoteLoadAnnounceWriterProvider) InitWriter(ctx context.Context) (load
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type remoteLoadAnnounceWriter struct {
|
type remoteLoadAnnounceWriter struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// EpochContext is a std context extended with epoch data.
|
// EpochContext is a std context extended with epoch data.
|
||||||
|
// nolint: containedctx
|
||||||
type EpochContext struct {
|
type EpochContext struct {
|
||||||
context.Context
|
context.Context
|
||||||
E uint64
|
E uint64
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/reputation"
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/reputation"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type commonPrm struct {
|
type commonPrm struct {
|
||||||
cli coreclient.Client
|
cli coreclient.Client
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// SearchSGPrm groups the parameters which are formed by Processor to search the storage group objects.
|
// SearchSGPrm groups the parameters which are formed by Processor to search the storage group objects.
|
||||||
|
// nolint: containedctx
|
||||||
type SearchSGPrm struct {
|
type SearchSGPrm struct {
|
||||||
Context context.Context
|
Context context.Context
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@ type SearchSGDst struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSGPrm groups parameter of GetSG operation.
|
// GetSGPrm groups parameter of GetSG operation.
|
||||||
|
// nolint: containedctx
|
||||||
type GetSGPrm struct {
|
type GetSGPrm struct {
|
||||||
Context context.Context
|
Context context.Context
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type contextPrm struct {
|
type contextPrm struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ type Option func(*cfg)
|
||||||
type Callback func()
|
type Callback func()
|
||||||
|
|
||||||
// groups the configurations with default values.
|
// groups the configurations with default values.
|
||||||
|
// nolint: containedctx
|
||||||
type cfg struct {
|
type cfg struct {
|
||||||
ctx context.Context // neo-go client context
|
ctx context.Context // neo-go client context
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,7 @@ type ContextPrm struct {
|
||||||
pdpWorkerPool, porWorkerPool util.WorkerPool
|
pdpWorkerPool, porWorkerPool util.WorkerPool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type commonCommunicatorPrm struct {
|
type commonCommunicatorPrm struct {
|
||||||
Context context.Context
|
Context context.Context
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Task groups groups the container audit parameters.
|
// Task groups groups the container audit parameters.
|
||||||
|
// nolint: containedctx
|
||||||
type Task struct {
|
type Task struct {
|
||||||
reporter Reporter
|
reporter Reporter
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ type StartPrm struct {
|
||||||
Epoch uint64
|
Epoch uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type commonContext struct {
|
type commonContext struct {
|
||||||
epoch uint64
|
epoch uint64
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type routeContext struct {
|
type routeContext struct {
|
||||||
context.Context
|
context.Context
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ type statusError struct {
|
||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type execCtx struct {
|
type execCtx struct {
|
||||||
svc *Service
|
svc *Service
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ type statusError struct {
|
||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type execCtx struct {
|
type execCtx struct {
|
||||||
svc *Service
|
svc *Service
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ import (
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session"
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type commonPrm struct {
|
type commonPrm struct {
|
||||||
cli coreclient.Client
|
cli coreclient.Client
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type remoteTarget struct {
|
type remoteTarget struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import (
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type Streamer struct {
|
type Streamer struct {
|
||||||
*cfg
|
*cfg
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ type statusError struct {
|
||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type execCtx struct {
|
type execCtx struct {
|
||||||
svc *Service
|
svc *Service
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,7 @@ func (p *Policer) processObject(ctx context.Context, addrWithType objectcore.Add
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type processPlacementContext struct {
|
type processPlacementContext struct {
|
||||||
context.Context
|
context.Context
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ type ContinuePrm struct {
|
||||||
Epoch uint64
|
Epoch uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type iterContext struct {
|
type iterContext struct {
|
||||||
context.Context
|
context.Context
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ type IterationTrust struct {
|
||||||
|
|
||||||
// IterContext aggregates context and data required for
|
// IterContext aggregates context and data required for
|
||||||
// iterations.
|
// iterations.
|
||||||
|
// nolint: containedctx
|
||||||
type IterContext struct {
|
type IterContext struct {
|
||||||
context.Context
|
context.Context
|
||||||
EpochIteration
|
EpochIteration
|
||||||
|
|
|
@ -51,6 +51,7 @@ type reportContext struct {
|
||||||
ctx common.Context
|
ctx common.Context
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// nolint: containedctx
|
||||||
type iteratorContext struct {
|
type iteratorContext struct {
|
||||||
context.Context
|
context.Context
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue