uint8z

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BitSize is the size in bits of this type.
	BitSize = 8
)

Variables

This section is empty.

Functions

func MapToSlice

func MapToSlice(m map[uint8]struct{}) []uint8

MapToSlice converts a map to slice.

func MustParse

func MustParse(v string) uint8

MustParse is like Parse but panics on error.

func Parse

func Parse(v string) (uint8, error)

Parse parses a string as base 10 uint8.

func Ptr

func Ptr(v uint8) *uint8

Ptr returns a pointer to the value.

func PtrDefToNil

func PtrDefToNil(v uint8, def uint8) *uint8

PtrDefToNil returns a pointer to the value, or nil if "def".

func PtrZeroToNil

func PtrZeroToNil(v uint8) *uint8

PtrZeroToNil returns a pointer to the value, or nil if 0.

func SafeIndex

func SafeIndex(s []uint8, i int) uint8

SafeIndex returns "s[i]" if possible, and 0 otherwise.

func SafeIndexDef

func SafeIndexDef(s []uint8, i int, def uint8) uint8

SafeIndexDef returns "s[i]" if possible, and "def" otherwise.

func SafeIndexPtr

func SafeIndexPtr(s []uint8, i int) *uint8

SafeIndexPtr returns "s[i]" if possible, and nil otherwise.

func SliceToMap

func SliceToMap(s []uint8) map[uint8]struct{}

SliceToMap converts a slice to map.

func Val

func Val(v *uint8) uint8

Val returns the pointer value, defaulting to zero if nil.

func ValDef

func ValDef(v *uint8, def uint8) uint8

ValDef returns the pointer value, defaulting to "def" if nil.

Types

type Slice

type Slice []uint8

Slice is a slice of values.

func (Slice) Len

func (s Slice) Len() int

Len implements the sort.Interface interface.

func (Slice) Less

func (s Slice) Less(i, j int) bool

Less implements the sort.Interface interface.

func (Slice) Swap

func (s Slice) Swap(i, j int)

Swap implements the sort.Interface interface.

Jump to

Keyboard shortcuts

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