Skip to content

Commit 7741535

Browse files
modernize for loops
1 parent a51cd00 commit 7741535

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ jobs:
3333
- name: golangci-lint
3434
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # tag=v8.0.0
3535
with:
36-
version: v2.5.0
36+
version: v2.6.0
3737
args: --output.text.print-linter-name=true --output.text.colors=true --timeout 10m
3838
working-directory: ${{matrix.working-directory}}

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ linters:
3232
- iotamixing
3333
- makezero
3434
- misspell
35+
- modernize
3536
- nakedret
3637
- nilerr
3738
- nolintlint

pkg/genall/help/pretty/print.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ func writePadding(out io.Writer, typ []byte, amt int) error {
291291

292292
num := amt / len(typ)
293293
rem := amt % len(typ)
294-
for i := 0; i < num; i++ {
294+
for range num {
295295
if _, err := out.Write(typ); err != nil {
296296
return err
297297
}

pkg/rbac/parser_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
var _ = Describe("ClusterRole generated by the RBAC Generator", func() {
2020
// run this test multiple times to make sure the Rule order is stable.
2121
const stableTestCount = 5
22-
for i := 0; i < stableTestCount; i++ {
22+
for range stableTestCount {
2323
It("should match the expected result", func() {
2424
By("switching into testdata to appease go modules")
2525
cwd, err := os.Getwd()

pkg/webhook/parser_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ var _ = Describe("Webhook Generation From Parsing to CustomResourceDefinition",
276276
Expect(err).NotTo(HaveOccurred())
277277
defer os.RemoveAll(outputDir)
278278

279-
for i := 0; i < 10; i++ {
279+
for range 10 {
280280
genCtx := &genall.GenerationContext{
281281
Collector: &markers.Collector{Registry: reg},
282282
Roots: pkgs,

0 commit comments

Comments
 (0)