From f9ece4f0416bea9a8b0c9a50ce2c66f7dc1d9efe Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Thu, 31 Oct 2024 13:31:51 +0800 Subject: [PATCH] p2p: fix staticcheck warning SA4030: rand.Intn(1) always returns 0 --- p2p/peer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/peer_test.go b/p2p/peer_test.go index a3e1c74fd8..20d020f186 100644 --- a/p2p/peer_test.go +++ b/p2p/peer_test.go @@ -150,7 +150,7 @@ func TestPeerDisconnect(t *testing.T) { // This test is supposed to verify that Peer can reliably handle // multiple causes of disconnection occurring at the same time. func TestPeerDisconnectRace(t *testing.T) { - maybe := func() bool { return rand.Intn(1) == 1 } + maybe := func() bool { return rand.Intn(2) == 1 } for i := 0; i < 1000; i++ { protoclose := make(chan error)