random

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FisherYatesShuffle

func FisherYatesShuffle(indexes []int, randomizer intRandomizer) []int

FisherYatesShuffle will shuffle the provided indexes slice based on a provided randomizer

Types

type ConcurrentSafeIntRandomizer

type ConcurrentSafeIntRandomizer struct {
}

ConcurrentSafeIntRandomizer implements dataRetriever.IntRandomizer and can be accessed in a concurrent manner

func (*ConcurrentSafeIntRandomizer) Intn

func (csir *ConcurrentSafeIntRandomizer) Intn(n int) int

Intn returns an int in [0, n) interval

func (*ConcurrentSafeIntRandomizer) IsInterfaceNil

func (csir *ConcurrentSafeIntRandomizer) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

Jump to

Keyboard shortcuts

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