Documentation
¶
Index ¶
- Variables
- func A(b bool, msgS ...string)
- func Bind[T any](err error, fn func() (T, error)) (T, error)
- func Bind0(err error, fn func() error) error
- func Bind1[T any](err error, fn func() (T, error)) (T, error)
- func Bind2[T any, U any](err error, fn func() (T, U, error)) (T, U, error)
- func Catch(errRef *error)
- func Debugger()
- func E(rest ...any) error
- func Err[T any](err error) (T, error)
- func Ignore[T any](T, ...any)
- func Let[T any](err error, fn func() T) T
- func Let0(err error, fn func())
- func Let1[T any](err error, fn func() T) T
- func Let2[T any, U any](err error, fn func() (T, U)) (T, U)
- func Ok[T any](value T) (T, error)
- func P[T any](v T) *T
- func PMap[T any, U any](pt *T, fn func(*T) *U) *U
- func PR[T any](ptr *T, err error) *pointerResult[T]
- func Ptr[T any](v T) *T
- func PtrMap[T any, U any](pt *T, fn func(*T) *U) *U
- func R[T any](value T, err error) *pointerResult[T]
- func RecoverPanicObject[T comparable](errRef *error, target T, fn func() error)
- func RecoverPanicType[T any](errRef *error, fn func(T) error)
- func Ternary[T any](cond bool, t T, f T) T
- func TernaryF[T any](cond bool, t func() T, f func() T) (ret T)
- func Then(err error, fn func() error) error
- func V[T any](value T, err error) T
- func V0[T any](first T, rest ...any)
- func V2[T any, U any](value1 T, value2 U, err error) (T, U)
- func V3[T any, U any, V any](value1 T, value2 U, value3 V, err error) (T, U, V)
Constants ¶
This section is empty.
Variables ¶
View Source
var Assert = A
View Source
var WaitForDebugger = Debugger
Functions ¶
func Bind ¶
Bind returns the result of the given function that can fail if err is nil, otherwise the error.
func Debugger ¶ added in v0.0.2024021544
func Debugger()
Debugger waits for a debugger to connect if the environment variable $WAIT or $DEBUG is set
func Let0 ¶
func Let0(err error, fn func())
Let0 calls the given function if err is nil and returns nothing.
func RecoverPanicObject ¶
func RecoverPanicObject[T comparable](errRef *error, target T, fn func() error)
func RecoverPanicType ¶
func TernaryF ¶
TernaryF returns the result of the first function if cond is true, otherwise the result of the second function.
Types ¶
This section is empty.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.