Documentation ¶
Index ¶
- Constants
- func Any[T any](s []T, f func(T) bool) bool
- func Concurrently(fns ...func() (any, error)) concurrentResultSlice
- func Contains[T comparable](s []T, el T) bool
- func Disjoin[T any](a []T, predicate func(el T) bool) ([]T, []T)
- func EmptyThenNil(s string) *string
- func ErrGroup[T any](limit int) *errGroup[T]
- func Filter[T any](s []T, f func(T) bool) []T
- func Find[T any](s []T, f func(T) bool) (T, bool)
- func Flat[T any](s [][]T) []T
- func HashString(s string) string
- func Map[T, U any](s []T, f func(T) U) []U
- func Mapper[Key comparable, T any](s []T, f func(T) Key) map[Key]T
- func Or[T any](val *T, fallback *T) *T
- func OrDefault[T any](val *T, def T) T
- func Ptr[T any](t T) *T
- func ReadZipFile(zf *zip.File) ([]byte, error)
- func Reduce[T, U any](s []T, f func(U, T) U, init U) U
- func SafeDereference(s *string) string
- func Some[T any](s []T, f func(T) bool) bool
- func UniqBy[T any, K comparable](s []T, f func(T) K) []T
- func Unzip(src, dest string) error
- func ZipReaderFromResponse(resp *http.Response) (*zip.Reader, error)
- type CompareResult
- type Date
Constants ¶
View Source
const ISO8601Format = "2006-01-02T15:04:05.000"
Variables ¶
This section is empty.
Functions ¶
func Concurrently ¶
func Contains ¶ added in v0.5.14
func Contains[T comparable](s []T, el T) bool
func EmptyThenNil ¶ added in v0.5.1
func HashString ¶
func Mapper ¶
func Mapper[Key comparable, T any](s []T, f func(T) Key) map[Key]T
func SafeDereference ¶
func UniqBy ¶ added in v0.5.1
func UniqBy[T any, K comparable](s []T, f func(T) K) []T
Types ¶
type CompareResult ¶
type CompareResult[T any] struct { OnlyInA []T OnlyInB []T InBoth []T }
func CompareSlices ¶
func CompareSlices[T any, K comparable](a, b []T, serializer func(T) K) CompareResult[T]
Source Files ¶
Click to show internal directories.
Click to hide internal directories.