uinty

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(vs []uint, v uint) bool

Contains returns true if vs contains v. NOTE: this function is deprecated. Use slicey.Contains instead.

func FromString

func FromString(s string) (uint, error)

FromString parses s and returns a uint.

func FromStringOrDefault added in v0.1.0

func FromStringOrDefault(s string, defaultVal uint) uint

FromStringOrDefault parses s and returns a uint.

func Max

func Max(v uint, vs ...uint) uint

Max returns the maximum value from v and vs. NOTE: this method is deprecated. Use helpy.Max instead.

func Min

func Min(v uint, vs ...uint) uint

Min returns the minimum value from v and vs. NOTE: this method is deprecated. Use helpy.Min instead.

func Pointer

func Pointer(v uint) *uint

Pointer returns a pointer to the given uint. NOTE: this method is deprecated. Use helpy.Pointer instead.

func Random

func Random() uint

Random returns a non-negative pseudo-random number of type uint

func RandomN

func RandomN(n uint) uint

RandomN returns a non-negative pseudo-random number in [0,n) of type uint. It panics if n <= 0.

func Sort

func Sort(vs []uint) []uint

Sort sorts data in place. Not guaranteed to be stable.

func UintOrDefault

func UintOrDefault(v *uint, defaultVal uint) *uint

UintOrDefault returns uint if it is not nil, and a pointer to defaultVal otherwise. NOTE: this method is deprecated. Use helpy.DerefOrValue instead.

func Unique

func Unique(vs []uint) []uint

Unique returns a new list containing unique uints from the given input NOTE: this function is deprecated. Use slicey.Unique instead.

Types

type Set

type Set helpy.Set[uint]

NOTE: this type is deprecated. Use helpy.Set instead

func MakeSet

func MakeSet(vs ...uint) Set

MakeSet returns a lookup map for uint NOTE: this function is deprecated. Use helpy.MakeSet instead.

func ToSet

func ToSet(vs []uint) Set

ToSet returns a lookup map for uint. NOTE: this function is deprecated. Use helpy.ToSet instead.

func (Set) Contains

func (s Set) Contains(v uint) bool

func (Set) Equal

func (s Set) Equal(s2 Set) bool

func (Set) Intersect

func (s Set) Intersect(s2 Set) Set

func (Set) Union

func (s Set) Union(s2 Set) Set

type UintSlice

type UintSlice []uint

func (UintSlice) Len

func (p UintSlice) Len() int

func (UintSlice) Less

func (p UintSlice) Less(i, j int) bool

func (UintSlice) Swap

func (p UintSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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