Skip to content

Commit aa5bd13

Browse files
alexandearcenkalti
authored andcommitted
use math/rand/v2 instead of math/rand
1 parent 34d5e39 commit aa5bd13

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

exponential.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package backoff
22

33
import (
4-
"math/rand"
4+
"math/rand/v2"
55
"time"
66
)
77

tries_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ package backoff
44

55
import (
66
"errors"
7-
"math/rand"
7+
"math/rand/v2"
88
"testing"
99
"time"
1010
)
1111

1212
func TestMaxTriesHappy(t *testing.T) {
13-
r := rand.New(rand.NewSource(time.Now().UnixNano()))
14-
max := 17 + r.Intn(13)
13+
max := 17 + rand.IntN(13)
1514
bo := WithMaxRetries(&ZeroBackOff{}, uint64(max))
1615

1716
// Load up the tries count, but reset should clear the record

0 commit comments

Comments
 (0)