Merge pull request #717 from gzliudan/fix-sa4030

p2p: fix staticcheck warning SA4030: rand.Intn(1) always returns 0
This commit is contained in:
Daniel Liu 2024-11-01 11:33:18 +08:00 committed by GitHub
commit 2e4f8a4175
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)