Skip to content

Commit 8b1b130

Browse files
committed
refactor: use math/rand/v2 instead of math/rand
Signed-off-by: Oleksandr Redko <[email protected]>
1 parent 5fc3e81 commit 8b1b130

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ linters-settings:
8484
deny:
8585
- pkg: "golang.org/x/net/context"
8686
desc: "use the 'context' package from the standard library"
87+
- pkg: "math/rand$"
88+
desc: "use the 'math/rand/v2' package"
8789
forbidigo:
8890
analyze-types: true
8991
forbid:

pkg/windows/registry_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package windows
22

33
import (
44
"fmt"
5-
"math/rand"
5+
"math/rand/v2"
66
"slices"
77
"sort"
88
"strconv"
@@ -168,7 +168,7 @@ func GetRandomFreeVSockPort(min, max int) (int, error) {
168168
}
169169
}
170170

171-
v := rand.Intn(max - min + 1 - len(used))
171+
v := rand.IntN(max - min + 1 - len(used))
172172

173173
for len(tree) > 1 {
174174
m := len(tree) / 2

0 commit comments

Comments
 (0)