internal

package module
v0.0.0-...-4309e98 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Always

func Always[T any](value T) func() T

Always returns a function that wrap the value

func IfNotNil

func IfNotNil[From any, To any](value *From, mapper func(*From) To) To

IfNotNil apply the mapper func if the value is not nil returns zero value otherwise.

func IfNotNilP

func IfNotNilP[From any, To any](value *From, mapper func(*From) To) *To

IfNotNilP apply the mapper func if the value is not nil returns nil otherwise.

func Map

func Map[From any, To any](from []From, mapper func(From) To) []To

Map apply the given function to all list elements.

func MapValuesErr

func MapValuesErr[From any, To any](from map[string]From, mapper func(From) (To, error)) (map[string]To, error)

MapValues transform map values by applying mapper func.

func Ternary

func Ternary[Value any](r bool, trueF func() Value, falseF func() Value) Value

Ternary executes like a ternary expression bool ? true: false

func WrapF

func WrapF[From any, To any](applier func(From) To, from From) func() To

WrapF returns a function that waits to be called to apply the parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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