assert

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

func Errorf[T any](res types.Result[T], format string, args ...any)

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

func Falsef(condition bool, format string, args ...any)

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

func Nilf(value any, format string, args ...any)

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 None

func None[T any](opt types.Option[T])

func Nonef

func Nonef[T any](opt types.Option[T], format string, args ...any)

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

func NotNilf(value any, format string, args ...any)

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

func Okf[T any](res types.Result[T], format string, args ...any)

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

func Some

func Some[T any](opt types.Option[T])

func Somef

func Somef[T any](opt types.Option[T], format string, args ...any)

func True

func True(condition bool)

True tests the condition. If the condition is false True panics True is meant to be used with `defer handle.Error()`

func Truef

func Truef(condition bool, format string, args ...any)

True tests the condition. If the condition is false True panics True is meant to be used with `defer handle.Error()`

Types

This section is empty.

Jump to

Keyboard shortcuts

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