@@ -37,7 +37,7 @@ func TestThrottleBacklog(t *testing.T) {
3737 // The throttler processes 10 consecutive requests, each one of those
3838 // requests lasts 1s. The maximum number of requests this can possible serve
3939 // before the clients time out (5s) is 40.
40- for i := 0 ; i < 40 ; i ++ {
40+ for i := range 40 {
4141 wg .Add (1 )
4242 go func (i int ) {
4343 defer wg .Done ()
@@ -75,7 +75,7 @@ func TestThrottleClientTimeout(t *testing.T) {
7575
7676 var wg sync.WaitGroup
7777
78- for i := 0 ; i < 10 ; i ++ {
78+ for i := range 10 {
7979 wg .Add (1 )
8080 go func (i int ) {
8181 defer wg .Done ()
@@ -108,7 +108,7 @@ func TestThrottleTriggerGatewayTimeout(t *testing.T) {
108108 var wg sync.WaitGroup
109109
110110 // These requests will be processed normally until they finish.
111- for i := 0 ; i < 50 ; i ++ {
111+ for i := range 50 {
112112 wg .Add (1 )
113113 go func (i int ) {
114114 defer wg .Done ()
@@ -123,7 +123,7 @@ func TestThrottleTriggerGatewayTimeout(t *testing.T) {
123123
124124 // These requests will wait for the first batch to complete but it will take
125125 // too much time, so they will eventually receive a timeout error.
126- for i := 0 ; i < 50 ; i ++ {
126+ for i := range 50 {
127127 wg .Add (1 )
128128 go func (i int ) {
129129 defer wg .Done ()
@@ -161,7 +161,7 @@ func TestThrottleMaximum(t *testing.T) {
161161
162162 var wg sync.WaitGroup
163163
164- for i := 0 ; i < 20 ; i ++ {
164+ for i := range 20 {
165165 wg .Add (1 )
166166 go func (i int ) {
167167 defer wg .Done ()
@@ -181,7 +181,7 @@ func TestThrottleMaximum(t *testing.T) {
181181
182182 // At this point the server is still processing, all the following request
183183 // will be beyond the server capacity.
184- for i := 0 ; i < 20 ; i ++ {
184+ for i := range 20 {
185185 wg .Add (1 )
186186 go func (i int ) {
187187 defer wg .Done ()
@@ -283,7 +283,7 @@ func TestThrottleCustomStatusCode(t *testing.T) {
283283 codes := make (chan int , totalRequestCount )
284284 errs := make (chan error , totalRequestCount )
285285 client := & http.Client {Timeout : timeout }
286- for i := 0 ; i < totalRequestCount ; i ++ {
286+ for range totalRequestCount {
287287 go func () {
288288 resp , err := client .Get (server .URL )
289289 if err != nil {
@@ -305,7 +305,7 @@ func TestThrottleCustomStatusCode(t *testing.T) {
305305 }
306306 }
307307
308- for i := 0 ; i < totalRequestCount - 1 ; i ++ {
308+ for range totalRequestCount - 1 {
309309 waitResponse (http .StatusServiceUnavailable )
310310 }
311311 close (wait ) // Allow the last request to proceed.
0 commit comments