Documentation ¶
Index ¶
- Variables
- func Array[T any](items ...T) []T
- func At[T any](vs []T, i int, fallback ...T) (out T)
- func Atoi[T Number](in string) (out T, err error)
- func CompareChain[T any](compares ...func(a, b T) int) func(a, b T) int
- func ErrDebug(err error) slog.Level
- func ErrInfo(err error) slog.Level
- func Filter[S ~[]I, I any, F func(I) bool | func(I, int) bool](s S, f F) (r S)
- func First[T any](vs []T, fallback ...T) (out T)
- func Flatten[T any](s [][]T) []T
- func ForEach[I any, F func(I) | func(I, int) | func(I) bool | func(I, int) bool](s []I, f F)
- func FormatInt[T Int | Uint](in T, base ...int) string
- func Iif[T any](cond bool, t, f T) T
- func IifF[T any](cond bool, t, f func() T) (out T)
- func Itoa[T Number | ~bool](in T) string
- func Last[T any](vs []T, fallback ...T) (out T)
- func Map[I any, O any, ...](s []I, f F) (r []O)
- func May[T any](v T, _ error) T
- func Must[T any](v T, err error) T
- func Select[T comparable](vs ...T) (out T)
- func Selects[T comparable](vs []T, fallback ...T) (out T)
- type Float
- type IfElse
- type Int
- type Integer
- type Number
- type Uint
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ParseByte = mkParseUint[byte](8) ParseUint8 = mkParseUint[uint8](8) ParseUint16 = mkParseUint[uint16](16) ParseUint32 = mkParseUint[uint32](32) ParseUint64 = mkParseUint[uint64](64) ParseInt8 = mkParseInt[int8](8) ParseInt16 = mkParseInt[int16](16) ParseInt32 = mkParseInt[int32](32) ParseInt64 = mkParseInt[int64](64) ParseFloat32 = mkParseFloat[float32](32) ParseFloat64 = mkParseFloat[float64](64) )
Functions ¶
func CompareChain ¶
CompareChain creates a compare function from the given compare functions.
func Filter ¶
Filter returns a new slice of the passed in slice, applying the passed in function to each item.
func Flatten ¶
func Flatten[T any](s [][]T) []T
Flatten returns a new slice concatenating the passed in slices.
Types ¶
Click to show internal directories.
Click to hide internal directories.