util

package
v1.0.0-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRandomIndices

func GetRandomIndices(indiceCount, highestIndex int) []int

GetRandomIndices returns a slice of random indices from 0 to given highestIndex

func IndexInSlice

func IndexInSlice(array interface{}, o interface{}, equals Equals) int

IndexInSlice returns the index of given object o in array

func RandomInt

func RandomInt(n int) int

RandomInt returns, as an int, a non-negative pseudo-random integer in [0,n) It panics if n <= 0

func RandomUInt64

func RandomUInt64() uint64

RandomUInt64 returns a random uint64

Types

type Equals

type Equals func(a interface{}, b interface{}) bool

Equals returns whether a and b are the same

type Set

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

Set is a generic and thread-safe set container

Jump to

Keyboard shortcuts

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