op

package
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2023 License: MIT Imports: 2 Imported by: 5

Documentation

Overview

Package op provides generic operations that can be used for converting or reducing collections, loops, slices

Index

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 IfElse added in v0.0.4

func IfElse[T any](ok bool, tru, fal T) T

IfElse returns the tru value if ok, otherwise return the fal value

func IfElseErr added in v0.0.8

func IfElseErr[T any](ok bool, tru T, err error) (T, error)

IfElseErr returns the tru value if ok, otherwise return the specified error

func IfGetElse added in v0.0.8

func IfGetElse[T any](ok bool, tru, fal func() T) T

IfGetElse exececutes the tru func if ok, otherwise exec the fal function and returns it result

func IfGetElseGetErr added in v0.0.8

func IfGetElseGetErr[T any](ok bool, tru func() T, fal func() error) (T, error)

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

func Sub added in v0.0.3

func Sub[T c.Number](a T, b T) T

Sub returns the substraction of the b from the a

func Sum added in v0.0.3

func Sum[T c.Summable](a T, b T) T

Sum returns the sum of 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL