Documentation ¶
Overview ¶
Package op provides generic operations that can be used for converting or reducing collections, loops, slices
Index ¶
- func IfDoElse[T any](ok bool, tru, fal func() (T, error)) (T, error)
- func IfElse[T any](ok bool, tru, fal T) (T, error)
- func Max[T constraints.Ordered](a T, b T) (T, error)
- func Min[T constraints.Ordered](a T, b T) (T, error)
- func Sub[T c.Number](a T, b T) (T, error)
- func Sum[T c.Summable](a T, b T) (T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IfDoElse ¶
IfDoElse exececutes the tru func if ok, otherwise exec the fal function and returns it result
func Max ¶
func Max[T constraints.Ordered](a T, b T) (T, error)
Max returns the maximum from two operands
func Min ¶
func Min[T constraints.Ordered](a T, b T) (T, error)
Min returns the minimum from two operands
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.