package rand
import "github.com/go-redis/redis/v8/internal/rand"
Index ¶
- func Int() int
- func Int63n(n int64) int64
- func Intn(n int) int
- func Perm(n int) []int
- func Seed(n int64)
- func Shuffle(n int, swap func(i, j int))
Functions ¶
func Int ¶
func Int() int
Int returns a non-negative pseudo-random int.
func Int63n ¶
Int63n returns, as an int64, a non-negative pseudo-random number in [0,n). It panics if n <= 0.
func Intn ¶
Intn returns, as an int, a non-negative pseudo-random number in [0,n). It panics if n <= 0.
func Perm ¶
Perm returns, as a slice of n ints, a pseudo-random permutation of the integers [0,n).
func Seed ¶
func Seed(n int64)
Seed uses the provided seed value to initialize the default Source to a deterministic state. If Seed is not called, the generator behaves as if seeded by Seed(1).
func Shuffle ¶
Shuffle pseudo-randomizes the order of elements. n is the number of elements. swap swaps the elements with indexes i and j.
Source Files ¶
- Version
- v8.11.5 (latest)
- Published
- Mar 17, 2022
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 1 week ago –
Tools for package owners.