Documentation ¶
Index ¶
- Variables
- func Any[T any](v T) any
- func AssertNil[T any](v T, terminator ...delegate.Action) bool
- func AssertNotNil[T any](v T, terminator ...delegate.Action) bool
- func AssertType[TAssert, TVal any](v TVal, terminator ...delegate.Action) bool
- func AssertZeroVal[T comparable](v T, terminator ...delegate.Action) bool
- func Between[T constraints.Ordered](v T, begin, end T) bool
- func ConvI2I64Any(val any) (int64, error)
- func Convert[T any](val any, defaultV T) (T, error)
- func ConvertMust[T any](val any) T
- func I2Str[T constraints.Integer](num T) string
- func IfThen[T any](cond bool, a T, b T) T
- func IsNil(v any) bool
- func IsNotNil(v any) bool
- func IsType[TAssert, TVal any](v TVal) bool
- func IsZero[T comparable](v T) bool
- func Keys[TKey comparable, TVal any](m map[TKey]TVal) []TKey
- func KeysSorted[TKey constraints.Ordered, TVal any](m map[TKey]TVal) []TKey
- func MapDump[TKey comparable, TVal any](m map[TKey]TVal, dumper delegate.Func2[TKey, TVal, string]) []string
- func MapForEachOrderly[TKey constraints.Ordered, TVal any](m map[TKey]TVal, traver func(key TKey, val TVal))
- func MapMap[TKey comparable, TVal any, TKey1 comparable, TVal1 any](m map[TKey]TVal, keyConv delegate.Convert[TKey, TKey1], ...) map[TKey1]TVal1
- func Or[T comparable](a, b T) T
- func PanicWhenError(err error, fmtOrMsg string, args ...any)
- func Ptr[T any](v T) *T
- func S2IMust[T constraints.Integer](str string) T
- func SliceContains[TVal comparable](slice []TVal, val TVal) bool
- func SliceFilter[TVal comparable](slice []TVal, pred delegate.Predicate[TVal]) []TVal
- func SliceFirst[TVal comparable](slice []TVal, val TVal) int
- func SliceFirstMatch[TVal comparable](slice []TVal, pred delegate.Predicate[TVal]) int
- func SliceForeach[TSliceVal any](slice []TSliceVal, foreachFn delegate.Action1[TSliceVal])
- func SliceForeachI[TSliceVal any](slice []TSliceVal, foreachFn delegate.Action2[TSliceVal, int])
- func SliceLast[TSliceVal any](slice []TSliceVal) TSliceVal
- func SliceMap[TFrom, TTo any](from []TFrom, mapFn delegate.Convert[TFrom, TTo]) []TTo
- func SliceMax[TSliceVal constraints.Ordered](data []TSliceVal) (ret TSliceVal)
- func SliceMin[TSliceVal constraints.Ordered](data []TSliceVal) (ret TSliceVal)
- func SlicePadRight[TSliceVal any](slice []TSliceVal, length int, padVal TSliceVal) []TSliceVal
- func SliceRand[TVal comparable](slice []TVal, defaultVal TVal) TVal
- func SliceReduce[TSliceVal, TTarget any](slice []TSliceVal, reduceFn func(TSliceVal, TTarget) TTarget, ...) TTarget
- func SliceReverse[TSliceVal any](data []TSliceVal)
- func SliceSort[TSliceVal constraints.Ordered](slice []TSliceVal)
- func SliceTryGet[TSliceVal any](slice []TSliceVal, i int, defaultVal TSliceVal) TSliceVal
- func Str[T any](v T) string
- func ZeroVal[T any]() (v T)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPropertyType = errors.New("got/typer: convert type failed")
Functions ¶
func AssertZeroVal ¶
func AssertZeroVal[T comparable](v T, terminator ...delegate.Action) bool
func Between ¶
func Between[T constraints.Ordered](v T, begin, end T) bool
func ConvI2I64Any ¶
func ConvertMust ¶
func I2Str ¶
func I2Str[T constraints.Integer](num T) string
func IsZero ¶
func IsZero[T comparable](v T) bool
func Keys ¶
func Keys[TKey comparable, TVal any](m map[TKey]TVal) []TKey
func KeysSorted ¶
func KeysSorted[TKey constraints.Ordered, TVal any](m map[TKey]TVal) []TKey
func MapForEachOrderly ¶
func MapForEachOrderly[TKey constraints.Ordered, TVal any](m map[TKey]TVal, traver func(key TKey, val TVal))
func MapMap ¶
func MapMap[TKey comparable, TVal any, TKey1 comparable, TVal1 any](m map[TKey]TVal, keyConv delegate.Convert[TKey, TKey1], valConv delegate.Convert[TVal, TVal1]) map[TKey1]TVal1
func Or ¶
func Or[T comparable](a, b T) T
func PanicWhenError ¶
func S2IMust ¶
func S2IMust[T constraints.Integer](str string) T
func SliceContains ¶
func SliceContains[TVal comparable](slice []TVal, val TVal) bool
func SliceFilter ¶
func SliceFilter[TVal comparable](slice []TVal, pred delegate.Predicate[TVal]) []TVal
func SliceFirst ¶
func SliceFirst[TVal comparable](slice []TVal, val TVal) int
func SliceFirstMatch ¶
func SliceFirstMatch[TVal comparable](slice []TVal, pred delegate.Predicate[TVal]) int
func SliceForeach ¶
func SliceForeachI ¶
func SliceMax ¶
func SliceMax[TSliceVal constraints.Ordered](data []TSliceVal) (ret TSliceVal)
func SliceMin ¶
func SliceMin[TSliceVal constraints.Ordered](data []TSliceVal) (ret TSliceVal)
func SlicePadRight ¶
func SliceRand ¶
func SliceRand[TVal comparable](slice []TVal, defaultVal TVal) TVal
func SliceReduce ¶
func SliceReduce[TSliceVal, TTarget any](slice []TSliceVal, reduceFn func(TSliceVal, TTarget) TTarget, defaultVal TTarget) TTarget
func SliceReverse ¶
func SliceReverse[TSliceVal any](data []TSliceVal)
func SliceSort ¶
func SliceSort[TSliceVal constraints.Ordered](slice []TSliceVal)
func SliceTryGet ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.