Documentation
¶
Index ¶
- func IdentityFunc[T any]() func(T) T
- func MergeOrdered[C cmp.Ordered, IN1, IN2, OUT []C](input1 IN1, input2 IN2) (out OUT)
- func MergeWithFunc[IN1, IN2, OUT any](input1 []IN1, input2 []IN2, cmp Comparer[IN1, IN2], conv1 Converter[IN1, OUT], ...) (out []OUT)
- func MergeWithFuncSimple[T any](in1 []T, in2 []T, cmp Comparer[T, T]) []T
- func SliceConvert[T any, V any](ts []T, converter Converter[T, V]) (vs []V)
- func UnmarshalReturn[T any](data []byte) (*T, error)
- func Zero[T any]() T
- type Comparer
- type Converter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IdentityFunc ¶
func IdentityFunc[T any]() func(T) T
IdentityFunc returns identity function of type T
func MergeOrdered ¶
MergeOrdered concatinates and sorts input1 and input2 and returns it. Parameters input1 and input2 must be sorted slices.
func MergeWithFunc ¶
func MergeWithFunc[IN1, IN2, OUT any]( input1 []IN1, input2 []IN2, cmp Comparer[IN1, IN2], conv1 Converter[IN1, OUT], conv2 Converter[IN2, OUT], ) (out []OUT)
MergeWithFunc merges input1 and input2 by comparing them with cmp function and constructing and returning a merged slice by using conv1, conv2 Converter functions.
func MergeWithFuncSimple ¶
MergeWithFuncSimple merges input1 and input2 by comparing them with cmp function and constructing and returning a merged slice.
func SliceConvert ¶
SliceConvert converts slices with given converter function.
func UnmarshalReturn ¶
UnmarshalReturn json.Unmarshal's to type T and returns it as a pointer.
Types ¶
Click to show internal directories.
Click to hide internal directories.