Skip to content

Commit 4071236

Browse files
authored
chore(test): Refactor loop to use range over integer in test (#2494)
1 parent ac5e56d commit 4071236

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/e2e/crds/v1alpha1/consumer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ spec:
190190
Check: scaffold.WithExpectedStatus(503),
191191
})
192192

193-
for i := 0; i < 10; i++ {
193+
for range 10 {
194194
s.RequestAssert(&scaffold.RequestAssert{
195195
Method: "GET",
196196
Path: "/get",

test/e2e/gatewayapi/httproute.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,7 @@ spec:
16761676
hitNginxCnt = 0
16771677
hitHttpbinCnt = 0
16781678
)
1679-
for i := 0; i < 20; i++ {
1679+
for range 20 {
16801680
resp := s.NewAPISIXClient().GET("/get").
16811681
WithHeader("Host", "httpbin.example").
16821682
Expect()
@@ -1702,7 +1702,7 @@ spec:
17021702
hitNginxCnt = 0
17031703
hitHttpbinCnt = 0
17041704
)
1705-
for i := 0; i < 20; i++ {
1705+
for range 20 {
17061706
resp := s.NewAPISIXClient().GET("/get").
17071707
WithHeader("Host", "httpbin.example").
17081708
Expect()
@@ -1879,7 +1879,7 @@ spec:
18791879
upstreamHosts := make(map[string]int)
18801880
totalRequests := 20
18811881

1882-
for i := 0; i < totalRequests; i++ {
1882+
for range totalRequests {
18831883
statusCode := s.NewAPISIXClient().GET("/headers").Expect().Raw().StatusCode
18841884
Expect(statusCode).To(Or(Equal(http.StatusOK), Equal(http.StatusMovedPermanently)))
18851885

0 commit comments

Comments
 (0)