Skip to content

Commit 44d7239

Browse files
committed
enable intrange linter
On-behalf-of: @SAP [email protected]
1 parent 35af1e9 commit 44d7239

File tree

41 files changed

+48
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+48
-47
lines changed

.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ linters:
2222
- govet
2323
- importas
2424
- ineffassign
25+
- intrange
2526
- misspell
2627
- nilerr
2728
- noctx

cmd/sharded-test-server/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func start(proxyFlags, shardFlags []string, logDirPath, workDirPath string, numb
217217

218218
// start shards
219219
var shards []*testshard.Shard
220-
for i := 0; i < numberOfShards; i++ {
220+
for i := range numberOfShards {
221221
shard, err := newShard(ctx, i, shardFlags, standaloneVW, servingCA, hostIP.String(), logDirPath, workDirPath, cacheServerConfigPath, clientCA)
222222
if err != nil {
223223
return err
@@ -235,7 +235,7 @@ func start(proxyFlags, shardFlags []string, logDirPath, workDirPath string, numb
235235
// TODO: support multiple virtual workspace servers (i.e. multiple ports)
236236
vwPort = "7444"
237237

238-
for i := 0; i < numberOfShards; i++ {
238+
for i := range numberOfShards {
239239
vw, err := newVirtualWorkspace(ctx, i, servingCA, hostIP.String(), logDirPath, workDirPath, clientCA, cacheServerConfigPath)
240240
if err != nil {
241241
return err

pkg/proxy/index/index_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (c *Controller) Start(ctx context.Context, numThreads int) {
146146
logger.Info("Starting controller")
147147
defer logger.Info("Shutting down controller")
148148

149-
for i := 0; i < numThreads; i++ {
149+
for range numThreads {
150150
go wait.UntilWithContext(ctx, c.startWorker, time.Second)
151151
}
152152

pkg/reconciler/apis/apibinding/apibinding_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ func (c *controller) Start(ctx context.Context, numThreads int) {
420420
logger.Info("Starting controller")
421421
defer logger.Info("Shutting down controller")
422422

423-
for i := 0; i < numThreads; i++ {
423+
for range numThreads {
424424
go wait.UntilWithContext(ctx, c.startWorker, time.Second)
425425
}
426426

pkg/reconciler/apis/apibindingdeletion/apibinding_deletion_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (c *Controller) Start(ctx context.Context, numThreads int) {
149149
logger.Info("Starting controller")
150150
defer logger.Info("Shutting down controller")
151151

152-
for i := 0; i < numThreads; i++ {
152+
for range numThreads {
153153
go wait.Until(func() { c.startWorker(ctx) }, time.Second, ctx.Done())
154154
}
155155

pkg/reconciler/apis/apiexport/apiexport_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func (c *controller) Start(ctx context.Context, numThreads int) {
271271
logger.Info("Starting controller")
272272
defer logger.Info("Shutting down controller")
273273

274-
for i := 0; i < numThreads; i++ {
274+
for range numThreads {
275275
go wait.UntilWithContext(ctx, c.startWorker, time.Second)
276276
}
277277

pkg/reconciler/apis/apiexportendpointslice/apiexportendpointslice_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (c *controller) Start(ctx context.Context, numThreads int) {
235235
logger.Info("Starting controller")
236236
defer logger.Info("Shutting down controller")
237237

238-
for i := 0; i < numThreads; i++ {
238+
for range numThreads {
239239
go wait.UntilWithContext(ctx, c.startWorker, time.Second)
240240
}
241241

pkg/reconciler/apis/apiexportendpointsliceurls/apiexportendpointsliceurls_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func (c *controller) Start(ctx context.Context, numThreads int) {
272272
logger.Info("Starting controller")
273273
defer logger.Info("Shutting down controller")
274274

275-
for i := 0; i < numThreads; i++ {
275+
for range numThreads {
276276
go wait.UntilWithContext(ctx, c.startWorker, time.Second)
277277
}
278278

pkg/reconciler/apis/crdcleanup/crdcleanup_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (c *controller) Start(ctx context.Context, numThreads int) {
162162
logger.Info("Starting controller")
163163
defer logger.Info("Shutting down controller")
164164

165-
for i := 0; i < numThreads; i++ {
165+
for range numThreads {
166166
go wait.UntilWithContext(ctx, c.startWorker, time.Second)
167167
}
168168

pkg/reconciler/apis/extraannotationsync/apibindingannotation_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (c *controller) Start(ctx context.Context, numThreads int) {
185185
logger.Info("Starting controller")
186186
defer logger.Info("Shutting down controller")
187187

188-
for i := 0; i < numThreads; i++ {
188+
for range numThreads {
189189
go wait.UntilWithContext(ctx, c.startWorker, time.Second)
190190
}
191191

0 commit comments

Comments
 (0)