Documentation
¶
Index ¶
- func AToInterfaces[S ~[]E, E any](s S) []interface{}
- func AToStrings[S ~[]E, E any](s S) []string
- func AddIfNotFound[S []E, E any](s S, f func(E) bool, e E) S
- func CleanEmptyStrings(s []string) []string
- func ContainsF[S ~[]E, E any](s S, f func(E) bool) bool
- func ContainsStr(s []string, e string) bool
- func Each[S ~[]E, E any](s S, f func(E))
- func Filter[S ~[]E, E any](s S, f func(E) bool) []E
- func Find[S ~[]E, E any](s S, f func(E) bool) (int, E)
- func FindAndDo[S ~[]E, E any](s S, f func(E) bool, do func(int, E))
- func FindMaxByTimeF[S ~[]E, E comparable](s S, f func(E) time.Time) E
- func FindMinByTimeF[S ~[]E, E comparable](s S, f func(E) time.Time) E
- func First[S ~[]E, E any](s S) E
- func GetFieldValue(s interface{}, fieldName string) (interface{}, bool)
- func GetFieldValueRecursive(s interface{}, fieldNames []string) (interface{}, bool)
- func Group[S ~[]E, E any, K comparable](s S, f func(E) K) map[K]S
- func Includes[S ~[]E, E any](s S, e E) bool
- func Increment[S ~[]E, E any](s S, f func(E) bool) int
- func IsLastIndex[E any](i int, s []E) bool
- func Join[E any](s []E, sep string) string
- func Last[S ~[]E, E any](s S) E
- func LastIndexOf[E any](s []E) int
- func Map[S ~[]E, E any, T any](s S, f func(E) T) []T
- func Merge[S ~[]E, S2 ~[]E, E any](s1 S, s2 S2) []E
- func MergeF[S ~[]E, S2 ~[]E2, E any, E2 any](s1 S, s2 S2, f func(E2) E) []E
- func Order[S ~[]E, E any](s S, f func(E, E) bool)
- func Pluck[S ~[]E, E any, K comparable](s S, f func(E) K) []K
- func PluckByField[S ~[]E, E any](s S, fieldName string) []interface{}
- func Reduce[S ~[]E, E any, V any](s S, f func(V, E) V, initialValue V) V
- func SumF[S ~[]E, E any, ...](s S, f func(E) T) T
- func Unique[S ~[]E, E comparable](s S) []E
- func UniqueF[S ~[]E, E any, K comparable](s S, f func(E) K) []E
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AToInterfaces ¶
func AToInterfaces[S ~[]E, E any](s S) []interface{}
func AToStrings ¶
func AddIfNotFound ¶
func CleanEmptyStrings ¶
func ContainsStr ¶
func FindMaxByTimeF ¶
func FindMaxByTimeF[S ~[]E, E comparable](s S, f func(E) time.Time) E
func FindMinByTimeF ¶
func FindMinByTimeF[S ~[]E, E comparable](s S, f func(E) time.Time) E
func GetFieldValue ¶
GetFieldValue gets the value of a struct field by its name
func GetFieldValueRecursive ¶
GetFieldValueRecursive retrieves the value of a struct field, potentially nested within multiple levels of structs. It handles pointers and returns the found value or nil if not found.
func Group ¶
func Group[S ~[]E, E any, K comparable](s S, f func(E) K) map[K]S
Group groups the elements of a collection by a specified key.
func IsLastIndex ¶
func LastIndexOf ¶
func Pluck ¶
func Pluck[S ~[]E, E any, K comparable](s S, f func(E) K) []K
func PluckByField ¶
func SumF ¶
func SumF[S ~[]E, E any, T constraints.Signed | constraints.Unsigned | ~float32 | ~float64](s S, f func(E) T) T
func Unique ¶
func Unique[S ~[]E, E comparable](s S) []E
func UniqueF ¶
func UniqueF[S ~[]E, E any, K comparable](s S, f func(E) K) []E
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.