Documentation ¶
Overview ¶
Package op provides generic operations that can be used for converting or reducing collections, loops, slices
Index ¶
- func Get[T any](getter func() T) T
- func IfElse[T any](ok bool, tru, fal T) T
- func IfElseErr[T any](ok bool, tru T, err error) (T, error)
- func IfGetElse[T any](ok bool, tru, fal func() T) T
- func IfGetElseGetErr[T any](ok bool, tru func() T, fal func() error) (T, error)
- func Max[T constraints.Ordered](a T, b T) T
- func Min[T constraints.Ordered](a T, b T) T
- func Sub[T c.Number](a T, b T) T
- func Sum[T c.Summable](a T, b T) T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶ added in v0.0.10
func Get[T any](getter func() T) T
Get calls the getter and returns the result
func IfElseErr ¶ added in v0.0.8
IfElseErr returns the tru value if ok, otherwise return the specified error
func IfGetElse ¶ added in v0.0.8
IfGetElse exececutes the tru func if ok, otherwise exec the fal function and returns it result
func IfGetElseGetErr ¶ added in v0.0.8
IfGetElseGetErr exececutes the tru func if ok, otherwise exec the fal function and returns its error
func Max ¶ added in v0.0.3
func Max[T constraints.Ordered](a T, b T) T
Max returns the maximum from two operands
func Min ¶ added in v0.0.3
func Min[T constraints.Ordered](a T, b T) T
Min returns the minimum from two operands
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package check provides common predicate functions
|
Package check provides common predicate functions |
not
Package not provides negalive predicates like 'not equals to'
|
Package not provides negalive predicates like 'not equals to' |
Package delay provides functions that return anonymous functions for delayed executions.
|
Package delay provides functions that return anonymous functions for delayed executions. |
replace
Package replace provides builders that specifies on value replacing
|
Package replace provides builders that specifies on value replacing |
string_
Package string_ provides string builders
|
Package string_ provides string builders |
string_/join
Package join provides string builders
|
Package join provides string builders |
string_/wrap
Package wrap provides wrap string builders
|
Package wrap provides wrap string builders |
sum
Package sum provides sum.Of alias
|
Package sum provides sum.Of alias |
Package string_ provides string utils
|
Package string_ provides string utils |
join
Package join provides concatenate string utils
|
Package join provides concatenate string utils |
wrap
Package wrap provides string wrap utils
|
Package wrap provides string wrap utils |
Package sum provides sum.Of alias
|
Package sum provides sum.Of alias |
Click to show internal directories.
Click to hide internal directories.