Skip to content

Commit e8f5b51

Browse files
committed
move disconnected comment
1 parent 9cd2adf commit e8f5b51

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

conn_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ func (tt *connTest) goDiscardLoop(c *websocket.Conn) {
461461
}
462462

463463
func BenchmarkConn(b *testing.B) {
464-
var benchCases = []struct {
464+
benchCases := []struct {
465465
name string
466466
mode websocket.CompressionMode
467467
}{
@@ -655,6 +655,7 @@ func TestConnClosePropagation(t *testing.T) {
655655
})
656656
}
657657
checkReadErr := func(t *testing.T, err error) {
658+
// Check read error (output depends on when read is called in relation to connection closure).
658659
var ce websocket.CloseError
659660
if errors.As(err, &ce) {
660661
assert.Equal(t, "", websocket.StatusNormalClosure, ce.Code)
@@ -668,7 +669,6 @@ func TestConnClosePropagation(t *testing.T) {
668669
err := c.Write(context.Background(), websocket.MessageText, want)
669670
assert.ErrorIs(t, net.ErrClosed, err)
670671

671-
// Check read error (output depends on when read is called in relation to connection closure).
672672
_, _, err = c.Read(context.Background())
673673
checkReadErr(t, err)
674674
}

0 commit comments

Comments
 (0)