uint8y

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

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

Contains returns true if vs contains v.

func FromString

func FromString(s string) (uint8, error)

FromString parses s and returns a uint8.

func Max

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

Max returns the maximum value from v and vs.

func Min

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

Min returns the minimum value from v and vs.

func Pointer

func Pointer(v uint8) *uint8

Pointer returns a pointer to the given uint8.

func Random

func Random() uint8

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

func RandomN

func RandomN(n uint8) uint8

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

func Sort

func Sort(vs []uint8) []uint8

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

func Uint8

func Uint8(v *uint8) uint8

Uint8 dereferences and returns uint8. The uint8 default value is returned if v is nil.

func Uint8OrDefault

func Uint8OrDefault(v *uint8, defaultVal uint8) *uint8

Uint8OrDefault returns uint8 if it is not nil, and a pointer to defaultVal otherwise.

func Unique

func Unique(vs []uint8) []uint8

Unique returns a new list containing unique uint8s from the given input

Types

type Set

type Set map[uint8]struct{}

func MakeSet

func MakeSet(vs ...uint8) Set

MakeSet returns a lookup map for uint8

func ToSet

func ToSet(vs []uint8) Set

ToSet returns a lookup map for uint8.

func (Set) Contains

func (s Set) Contains(v uint8) bool

Contains returns true if Set contains v.

func (Set) Equal

func (s Set) Equal(s2 Set) bool

Equal checks whether all

func (Set) Intersect

func (s Set) Intersect(s2 Set) Set

Intersect returns the intersection of two Sets.

func (Set) Union

func (s Set) Union(s2 Set) Set

Union returns the union of two Sets.

type Uint8Slice

type Uint8Slice []uint8

func (Uint8Slice) Len

func (p Uint8Slice) Len() int

func (Uint8Slice) Less

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

func (Uint8Slice) Swap

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

Jump to

Keyboard shortcuts

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