Skip to content

Commit 185251f

Browse files
authored
Merge pull request #2297 from zhanggbj/enable_containedctx
🌱 lint: enable containedctx lint
2 parents dd39b0a + 08f2a6b commit 185251f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ linters:
1313
- asciicheck
1414
- bidichk
1515
- bodyclose
16-
# - containedctx
16+
- containedctx
1717
- dogsled
1818
- dupword
1919
- durationcheck

pkg/context/controller_manager_context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
// ControllerManagerContext is the context of the controller that owns the
3434
// controllers.
3535
type ControllerManagerContext struct {
36-
context.Context
36+
context.Context //nolint:containedctx
3737

3838
// Namespace is the namespace in which the resource is located responsible
3939
// for running the controller manager.

pkg/services/govmomi/cluster/cluster_suite_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func TestCluster(t *testing.T) {
3333
}
3434

3535
type testComputeClusterCtx struct {
36-
context.Context
37-
finder *find.Finder
36+
context.Context //nolint:containedctx
37+
finder *find.Finder
3838
}
3939

4040
func (t testComputeClusterCtx) GetSession() *session.Session {

pkg/util/fetch_object.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
)
2929

3030
type FetchObjectInput struct {
31-
context.Context
31+
context.Context //nolint:containedctx
3232
ctrlclient.Client
3333
Object ctrlclient.Object
3434
}

test/helpers/vmware/intg_test_context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import (
4141
// IntegrationTestContext is used for integration testing
4242
// Supervisor controllers.
4343
type IntegrationTestContext struct {
44-
context.Context
44+
context.Context //nolint:containedctx
4545
Client client.Client
4646
GuestClient client.Client
4747
Namespace string

0 commit comments

Comments
 (0)