mirror of
https://github.com/samber/lo.git
synced 2025-10-05 07:56:51 +08:00

* refactor:refactor RandomString function * feat:Upgrade math/rand to math/rand/v2 * Update string.go Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com> * feat: improve comments for RandomString function * Update string.go Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr> * feat:Upgrade math/rand/v2 to github.com/samber/lo/internal/rand * Update string.go * Update ordered_go118.go --------- Co-authored-by: zhuhebin <zhuhebin@fengtaisec.com> Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com> Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
18 lines
216 B
Go
18 lines
216 B
Go
//go:build go1.22
|
|
|
|
package rand
|
|
|
|
import "math/rand/v2"
|
|
|
|
func Shuffle(n int, swap func(i, j int)) {
|
|
rand.Shuffle(n, swap)
|
|
}
|
|
|
|
func IntN(n int) int {
|
|
return rand.IntN(n)
|
|
}
|
|
|
|
func Int64() int64 {
|
|
return rand.Int64()
|
|
}
|