funcs

package
v0.0.0-...-b7aacc1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 2 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And[T any](predicateFuncs ...func(T) bool) func(T) bool

And returns a new predicate function that would return true if all of the given predicate functions return true for the given value; false otherwise

func Compose

func Compose[T1, T2, T3 any](f func(T1) T2, g func(T2) T3) func(T1) T3

Compose composes two compatible functions

func Identity

func Identity[T any](x T) T

Identity returns the given element

func Must

func Must[T any](result T, err error) T

Must returns the result if err is nil, panics otherwise

func MustNoErr

func MustNoErr(err error)

MustNoErr panics if err is not nil

func MustOk

func MustOk[T any](result T, ok bool) T

MustOk returns the result if ok, panics otherwise

func MustTrue

func MustTrue(ok bool)

MustTrue panics if not true, noop otherwise

func Not

func Not[T any](predicateFunc func(T) bool) func(T) bool

Not returns a new predicate function that would return true if the given predicate function returns false; false otherwise

func Or

func Or[T any](predicateFuncs ...func(T) bool) func(T) bool

Or returns a new predicate function that would return true if any of the given predicate functions returns true for the given value; false otherwise

Types

This section is empty.

Jump to

Keyboard shortcuts

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