Documentation ¶
Index ¶
- Variables
- func Choice(data interface{}, count int) []interface{}
- func ChoiceBool(data []bool, count int) []bool
- func ChoiceByte(data []byte, count int) []byte
- func ChoiceFloat32(data []float32, count int) []float32
- func ChoiceFloat64(data []float64, count int) []float64
- func ChoiceInt(data []int, count int) []int
- func ChoiceInt16(data []int16, count int) []int16
- func ChoiceInt32(data []int32, count int) []int32
- func ChoiceInt64(data []int64, count int) []int64
- func ChoiceInt8(data []int8, count int) []int8
- func ChoiceInter(data []interface{}, count int) []interface{}
- func ChoiceRune(data []rune, count int) []rune
- func ChoiceStr(data []string, count int) []string
- func ChoiceUint(data []uint, count int) []uint
- func ChoiceUint16(data []uint16, count int) []uint16
- func ChoiceUint32(data []uint32, count int) []uint32
- func ChoiceUint64(data []uint64, count int) []uint64
- func ChoiceUint8(data []uint8, count int) []uint8
- func RandomInt(min, max int) int
- func RandomString(length int) string
- func Shuffle(arr []interface{})
- type Rand
- type Source
- type Source64
- type Zipf
Constants ¶
This section is empty.
Variables ¶
View Source
var ExpFloat64 = rand.ExpFloat64
View Source
var Float32 = rand.Float32
View Source
var Float64 = rand.Float64
View Source
var Int = rand.Int
View Source
var Int31a = rand.Int31
View Source
var Int31n = rand.Int31n
View Source
var Int63 = rand.Int63
View Source
var Int63n = rand.Int63n
View Source
var Intn = rand.Intn
View Source
var New = rand.New
View Source
var NewSource = rand.NewSource
View Source
var NewZipf = rand.NewZipf
View Source
var NormFloat64 = rand.NormFloat64
View Source
var Perm = rand.Perm
View Source
var RShuffle = rand.Shuffle
View Source
var Read = rand.Read
View Source
var Seeda = rand.Seed
View Source
var Uint32 = rand.Uint32
View Source
var Uint64 = rand.Uint64
Functions ¶
func Choice ¶
func Choice(data interface{}, count int) []interface{}
Choice some random item from data. supports array, slice, map. This function use reflect, will be more slow than other Choice functions.
func ChoiceFloat32 ¶
Choice some random item from data.
func ChoiceFloat64 ¶
Choice some random item from data.
func ChoiceInt16 ¶
Choice some random item from data.
func ChoiceInt32 ¶
Choice some random item from data.
func ChoiceInt64 ¶
Choice some random item from data.
func ChoiceInter ¶
func ChoiceInter(data []interface{}, count int) []interface{}
Choice some random item from data.
func ChoiceUint16 ¶
Choice some random item from data.
func ChoiceUint32 ¶
Choice some random item from data.
func ChoiceUint64 ¶
Choice some random item from data.
func ChoiceUint8 ¶
Choice some random item from data.
Types ¶
Click to show internal directories.
Click to hide internal directories.