@@ -36,7 +36,7 @@ func TestConn(t *testing.T) {
36
36
return websocket .CompressionMode (xrand .Int (int (websocket .CompressionContextTakeover ) + 1 ))
37
37
}
38
38
39
- for i := 0 ; i < 5 ; i ++ {
39
+ for range 5 {
40
40
t .Run ("" , func (t * testing.T ) {
41
41
tt , c1 , c2 := newConnTest (t , & websocket.DialOptions {
42
42
CompressionMode : compressionMode (),
@@ -50,7 +50,7 @@ func TestConn(t *testing.T) {
50
50
51
51
c1 .SetReadLimit (131072 )
52
52
53
- for i := 0 ; i < 5 ; i ++ {
53
+ for range 5 {
54
54
err := wstest .Echo (tt .ctx , c1 , 131072 )
55
55
assert .Success (t , err )
56
56
}
@@ -76,7 +76,7 @@ func TestConn(t *testing.T) {
76
76
c1 .CloseRead (tt .ctx )
77
77
c2 .CloseRead (tt .ctx )
78
78
79
- for i := 0 ; i < 10 ; i ++ {
79
+ for range 10 {
80
80
err := c1 .Ping (tt .ctx )
81
81
assert .Success (t , err )
82
82
}
@@ -185,7 +185,7 @@ func TestConn(t *testing.T) {
185
185
const count = 100
186
186
errs := make (chan error , count )
187
187
188
- for i := 0 ; i < count ; i ++ {
188
+ for range count {
189
189
go func () {
190
190
select {
191
191
case errs <- c1 .Write (tt .ctx , websocket .MessageBinary , msg ):
@@ -195,7 +195,7 @@ func TestConn(t *testing.T) {
195
195
}()
196
196
}
197
197
198
- for i := 0 ; i < count ; i ++ {
198
+ for range count {
199
199
select {
200
200
case err := <- errs :
201
201
assert .Success (t , err )
@@ -341,7 +341,7 @@ func TestConn(t *testing.T) {
341
341
return wsjson .Write (tt .ctx , c1 , exp )
342
342
})
343
343
344
- var act interface {}
344
+ var act any
345
345
err := wsjson .Read (tt .ctx , c1 , & act )
346
346
assert .Success (t , err )
347
347
assert .Equal (t , "read msg" , exp , act )
@@ -372,7 +372,7 @@ func TestConn(t *testing.T) {
372
372
return wsjson .Write (tt .ctx , c1 , exp )
373
373
})
374
374
375
- var act interface {}
375
+ var act any
376
376
err := wsjson .Read (tt .ctx , c1 , & act )
377
377
assert .Success (t , err )
378
378
assert .Equal (t , "read msg" , exp , act )
@@ -408,7 +408,7 @@ func TestConn(t *testing.T) {
408
408
409
409
c1 .SetReadLimit (131072 )
410
410
411
- for i := 0 ; i < 5 ; i ++ {
411
+ for range 5 {
412
412
err := wstest .Echo (tt .ctx , c1 , 131072 )
413
413
assert .Success (t , err )
414
414
}
@@ -660,7 +660,7 @@ func assertEcho(tb testing.TB, ctx context.Context, c *websocket.Conn) {
660
660
return wsjson .Write (ctx , c , exp )
661
661
})
662
662
663
- var act interface {}
663
+ var act any
664
664
c .SetReadLimit (1 << 30 )
665
665
err := wsjson .Read (ctx , c , & act )
666
666
assert .Success (tb , err )
@@ -682,7 +682,7 @@ func assertClose(tb testing.TB, c *websocket.Conn) {
682
682
683
683
func TestConcurrentClosePing (t * testing.T ) {
684
684
t .Parallel ()
685
- for i := 0 ; i < 64 ; i ++ {
685
+ for range 64 {
686
686
func () {
687
687
c1 , c2 := wstest .Pipe (nil , nil )
688
688
defer c1 .CloseNow ()
0 commit comments