Documentation ¶
Index ¶
- func AddOrUpdateSlice[T any](slice []T, items ...T) []T
- func Filter[T any](objs []T, filter func(obj T) bool) []T
- func FilterMap[K comparable, V any](m map[K]V, f func(K, V) bool) map[K]V
- func First[T any](objs []T) (T, bool)
- func GetDefault[T any](s, d T) T
- func IsZero[T any](v T) bool
- func IteratePartitions[T comparable](devices []T, size int, callback func([][]T))
- func IterateSets[T any](devices []T, size int, callback func([]T))
- func Map[T any, K any](objs []T, mapper func(obj T) ([]K, bool)) []K
- func Max[T cmp.Ordered](ts ...T) T
- func Min[T cmp.Ordered](ts ...T) T
- func NoSpace(s string) bool
- func OR[T any](vs ...T) T
- func Range[T any](objs []T, fn func(obj T) bool)
- func SetContains[T comparable](set []T, d T) bool
- func SetCopyAndAddPadding[T comparable](set []T, size int) []T
- func SetCountPadding[T comparable](set []T) int
- func Sum[T cmp.Ordered](ts ...T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOrUpdateSlice ¶
func AddOrUpdateSlice[T any](slice []T, items ...T) []T
AddOrUpdateSlice add or update slice
func FilterMap ¶
func FilterMap[K comparable, V any](m map[K]V, f func(K, V) bool) map[K]V
FilterMap filter one map to another map
func IteratePartitions ¶
func IteratePartitions[T comparable](devices []T, size int, callback func([][]T))
func IterateSets ¶
func SetContains ¶
func SetContains[T comparable](set []T, d T) bool
func SetCopyAndAddPadding ¶
func SetCopyAndAddPadding[T comparable](set []T, size int) []T
func SetCountPadding ¶
func SetCountPadding[T comparable](set []T) int
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.