randutil

package
v3.8.7 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package randutil provides pseudo-random number generator utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockedRand added in v3.8.4

type LockedRand struct {
	// contains filtered or unexported fields
}

LockedRand wraps rand.Rand with a mutex.

func NewLockedRand added in v3.8.4

func NewLockedRand(src rand.Source) *LockedRand

NewLockedRand returns a new rand.Rand, which is safe for concurrent use.

func (*LockedRand) Float32 added in v3.8.4

func (r *LockedRand) Float32() float32

Float32 calls r.Rand.Float32 and is safe for concurrent use.

func (*LockedRand) Float64 added in v3.8.4

func (r *LockedRand) Float64() float64

Float64 calls r.Rand.Float64 and is safe for concurrent use.

func (*LockedRand) Int31 added in v3.8.4

func (r *LockedRand) Int31() int32

Int31 calls r.Rand.Int31 and is safe for concurrent use.

func (*LockedRand) Int63 added in v3.8.4

func (r *LockedRand) Int63() int64

Int63 calls r.Rand.Int63 and is safe for concurrent use.

func (*LockedRand) Intn added in v3.8.4

func (r *LockedRand) Intn(n int) int

Intn calls r.Rand.Intn and is safe for concurrent use.

func (*LockedRand) Read added in v3.8.4

func (r *LockedRand) Read(b []byte) (int, error)

Read is like rand.Rand.Read, but safe for concurrent use.

func (*LockedRand) Uint32 added in v3.8.4

func (r *LockedRand) Uint32() uint32

Uint32 calls r.Rand.Uint32 and is safe for concurrent use.

Jump to

Keyboard shortcuts

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