Documentation
¶
Index ¶
- func First[T any](s []T, f func(T) bool, last bool) (*T, bool)
- func Map[T any, S any](s []T, f func(T) S) []S
- func MapWithErr[T any, S any](s []T, f func(T) (S, error)) ([]S, error)
- func UniqueGroupBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee func(item T) U) (map[U]T, bool)
- type Diff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func First ¶
returns the first element in the slice where the predicate returns true if second argument is true the returns the last not the first
func MapWithErr ¶
MapWithErr maps elements of a slice from T to M, returning a new slice and a joined error if there are any. If an error is returned from the mapping function, a nil array and the error is returned.
func UniqueGroupBy ¶
func UniqueGroupBy[T any, U comparable, Slice ~[]T](collection Slice, iteratee func(item T) U) (map[U]T, bool)
Types ¶
type Diff ¶
type Diff[T comparable, S ~[]T] struct { // contains filtered or unexported fields }
func NewDiff ¶
func NewDiff[T comparable, S ~[]T](base, new S) *Diff[T, S]
func (Diff[T, S]) HasChanged ¶
func (Diff[T, S]) InAdditions ¶
func (Diff[T, S]) InRemovals ¶
Click to show internal directories.
Click to hide internal directories.