Documentation
¶
Index ¶
- Variables
- func Between[T cmp.Ordered](a, low, high T, msg ...string)
- func BetweenInclusive[T cmp.Ordered](a, low, high T, msg ...string)
- func Catch[T any](f func() T, catchable ...error) (out T, err error)
- func Eq[T comparable](a, b T, msg ...string)
- func ErrCfg(name string, opts ...ErrOpt)
- func ErrIs(e error, target error, msg ...string)
- func ErrPoint(name string) error
- func GT[T cmp.Ordered](a, b T, msg ...string)
- func GTE[T cmp.Ordered](a, b T, msg ...string)
- func Is[T any](a any, msg ...string)
- func LT[T cmp.Ordered](a, b T, msg ...string)
- func LTE[T cmp.Ordered](a, b T, msg ...string)
- func Must[T any](t T, err error, msg ...string) T
- func Nil(x any, msg ...string)
- func NotEq[T comparable](a, b T, msg ...string)
- func NotNil(x any, msg ...string)
- func Panics(f func(), msg ...string)
- func SliceContains[T comparable](s []T, v T, msg ...string)
- func SliceEq[T comparable](a, b []T, msg ...string)
- func SliceSorted[T cmp.Ordered](s []T, msg ...string)
- type ErrCondition
- type ErrOpt
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFault = errors.New("fault")
Functions ¶
func BetweenInclusive ¶
func Catch ¶
Catch executes f and converts panics into errors. If catchable errors are specified, only panics matching those errors (via errors.Is) are caught; others are re-panicked. Returns the result of f and any caught error.
func Eq ¶
func Eq[T comparable](a, b T, msg ...string)
Eq compares the two input values and panics if they are not equal
func NotEq ¶
func NotEq[T comparable](a, b T, msg ...string)
NotEq compares the two input values and panics if they are equal
func SliceContains ¶ added in v0.3.0
func SliceContains[T comparable](s []T, v T, msg ...string)
SliceContains panics if v is not found in s
func SliceEq ¶ added in v0.3.0
func SliceEq[T comparable](a, b []T, msg ...string)
SliceEq panics if slices a and b are not element-wise equal
func SliceSorted ¶ added in v0.3.0
SliceSorted panics if s is not sorted in ascending order
Types ¶
type ErrCondition ¶
Click to show internal directories.
Click to hide internal directories.