Documentation
¶
Index ¶
- func Error[T any](res types.Result[T])
- func Errorf[T any](res types.Result[T], format string, args ...any)
- func False(condition bool)
- func Falsef(condition bool, format string, args ...any)
- func Nil(value any)
- func Nilf(value any, format string, args ...any)
- func None[T any](opt types.Option[T])
- func Nonef[T any](opt types.Option[T], format string, args ...any)
- func NotNil(value any)
- func NotNilf(value any, format string, args ...any)
- func Ok[T any](res types.Result[T])
- func Okf[T any](res types.Result[T], format string, args ...any)
- func Some[T any](opt types.Option[T])
- func Somef[T any](opt types.Option[T], format string, args ...any)
- func True(condition bool)
- func Truef(condition bool, format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error[T any](res types.Result[T])
Error[T] casts the the types.Result[T] to types.Error[T]. If the cast fails, it panics with an ErrRecoverable
func Errorf ¶
Errorf[T] casts the the types.Result[T] to types.Error[T]. If the cast fails, it panics with an ErrRecoverable formatted with fmt.Errorf
func False ¶
func False(condition bool)
False tests the condition. If the condition is true, False panics False is meant to be used with `defer handle.Error()`
func Falsef ¶
Falsef tests the condition. If the condition is true, Falsef panics Falsef is meant to be used with `defer handle.Error()`
func Nil ¶
func Nil(value any)
Nil tests if the value is nil. If the value is not nil, Nil panics. Nil is meant to be used with defer handle.Error()
func Nilf ¶
Nilf tests if the value is nil. If the value is not nil, Nilf panics with the given message. Nilf is meant to be used with defer handle.Error()
func NotNil ¶
func NotNil(value any)
NotNil tests if the value is not nil. If the value is nil, NotNil panics. NotNil is meant to be used with defer
func NotNilf ¶
NotNilf tests if the value is not nil. If the value is nil, NotNilf panics with the given message. NotNilf is meant to be used with defer
func Ok ¶
func Ok[T any](res types.Result[T])
Ok[T] casts the the types.Result[T] to types.Ok[T]. If the cast fails, it panics with an ErrRecoverable
func Okf ¶
Okf[T] casts the the types.Result[T] to types.Ok[T]. If the cast fails, it panics with an ErrRecoverable formatted with fmt.Errorf
Types ¶
This section is empty.