elrand

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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 ChoiceBool

func ChoiceBool(data []bool, count int) []bool

Choice some random item from data.

func ChoiceByte

func ChoiceByte(data []byte, count int) []byte

Choice some random item from data.

func ChoiceFloat32

func ChoiceFloat32(data []float32, count int) []float32

Choice some random item from data.

func ChoiceFloat64

func ChoiceFloat64(data []float64, count int) []float64

Choice some random item from data.

func ChoiceInt

func ChoiceInt(data []int, count int) []int

Choice some random item from data.

func ChoiceInt16

func ChoiceInt16(data []int16, count int) []int16

Choice some random item from data.

func ChoiceInt32

func ChoiceInt32(data []int32, count int) []int32

Choice some random item from data.

func ChoiceInt64

func ChoiceInt64(data []int64, count int) []int64

Choice some random item from data.

func ChoiceInt8

func ChoiceInt8(data []int8, count int) []int8

Choice some random item from data.

func ChoiceInter

func ChoiceInter(data []interface{}, count int) []interface{}

Choice some random item from data.

func ChoiceRune

func ChoiceRune(data []rune, count int) []rune

Choice some random item from data.

func ChoiceStr

func ChoiceStr(data []string, count int) []string

Choice some random item from data.

func ChoiceUint

func ChoiceUint(data []uint, count int) []uint

Choice some random item from data.

func ChoiceUint16

func ChoiceUint16(data []uint16, count int) []uint16

Choice some random item from data.

func ChoiceUint32

func ChoiceUint32(data []uint32, count int) []uint32

Choice some random item from data.

func ChoiceUint64

func ChoiceUint64(data []uint64, count int) []uint64

Choice some random item from data.

func ChoiceUint8

func ChoiceUint8(data []uint8, count int) []uint8

Choice some random item from data.

func RandomInt

func RandomInt(min, max int) int

RandomInt returns a random int in [min,max)

func RandomString

func RandomString(length int) string

RandomString returns a random string.

func Shuffle

func Shuffle(arr []interface{})

Shuffle array or slice.

Types

type Rand

type Rand = rand.Rand

type Source

type Source = rand.Source

type Source64

type Source64 = rand.Source64

type Zipf

type Zipf = rand.Zipf

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL