Skip to content

Commit

Permalink
Merge pull request #2297 from zhanggbj/enable_containedctx
Browse files Browse the repository at this point in the history
🌱 lint: enable containedctx lint
  • Loading branch information
k8s-ci-robot authored Aug 29, 2023
2 parents dd39b0a + 08f2a6b commit 185251f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ linters:
- asciicheck
- bidichk
- bodyclose
# - containedctx
- containedctx
- dogsled
- dupword
- durationcheck
Expand Down
2 changes: 1 addition & 1 deletion pkg/context/controller_manager_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
// ControllerManagerContext is the context of the controller that owns the
// controllers.
type ControllerManagerContext struct {
context.Context
context.Context //nolint:containedctx

// Namespace is the namespace in which the resource is located responsible
// for running the controller manager.
Expand Down
4 changes: 2 additions & 2 deletions pkg/services/govmomi/cluster/cluster_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func TestCluster(t *testing.T) {
}

type testComputeClusterCtx struct {
context.Context
finder *find.Finder
context.Context //nolint:containedctx
finder *find.Finder
}

func (t testComputeClusterCtx) GetSession() *session.Session {
Expand Down
2 changes: 1 addition & 1 deletion pkg/util/fetch_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

type FetchObjectInput struct {
context.Context
context.Context //nolint:containedctx
ctrlclient.Client
Object ctrlclient.Object
}
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/vmware/intg_test_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
// IntegrationTestContext is used for integration testing
// Supervisor controllers.
type IntegrationTestContext struct {
context.Context
context.Context //nolint:containedctx
Client client.Client
GuestClient client.Client
Namespace string
Expand Down

0 comments on commit 185251f

Please sign in to comment.