Documentation
¶
Index ¶
- Constants
- func MapToSlice(m map[int]struct{}) []int
- func MustParse(v string) int
- func Parse(v string) (int, error)
- func Ptr(v int) *int
- func PtrDefToNil(v int, def int) *int
- func PtrZeroToNil(v int) *int
- func SafeIndex(s []int, i int) int
- func SafeIndexDef(s []int, i int, def int) int
- func SafeIndexPtr(s []int, i int) *int
- func SliceToMap(s []int) map[int]struct{}
- func Val(v *int) int
- func ValDef(v *int, def int) int
- type Slice
Constants ¶
View Source
const ( // BitSize is the size in bits of this type. BitSize = 32 << (^uint(0) >> 63) )
Variables ¶
This section is empty.
Functions ¶
func PtrDefToNil ¶
PtrDefToNil returns a pointer to the value, or nil if "def".
func PtrZeroToNil ¶
PtrZeroToNil returns a pointer to the value, or nil if 0.
func SafeIndexDef ¶
SafeIndexDef returns "s[i]" if possible, and "def" otherwise.
func SafeIndexPtr ¶
SafeIndexPtr returns "s[i]" if possible, and nil otherwise.
Types ¶
Click to show internal directories.
Click to hide internal directories.