package
2.16.0
Repository: https://github.com/tawesoft/golib.git
Documentation: pkg.go.dev

# Functions

Check panics if the error is not nil.
CheckAll panics at the first non-nil error.
Checkf panics if the error is not nil.
Equal panics if the provided comparable values are not equal.
Equalf panics if the provided comparable values are not equal.
Func takes a function f() => (x, error), and returns a function f() => x that may panic in the event of error.
Never signifies code that should never be reached.
Neverf signifies code that should never be reached.
Nil returns true if v is (untyped) nil.
Nilf returns true if v is (untyped) nil.
Not is the equivalent of Equal with a false value.
Notf is the equivalent of Equalf with a false value.
NotNil returns true if v is not (untyped) nil.
NotNilf returns true if v is not (untyped) nil.
Ok accepts a (value, ok) tuple as input and panics if ok is false, otherwise returns value.
Okf accepts a (value, ok) tuple, and a [fmt.Sprintf] -style format string with optional arguments, as input and panics if ok is false.
Result accepts a (value, err) tuple as input and panics if err != nil, otherwise returns value.
Resultf accepts a (value, err) tuple, and a [fmt.Sprintf] -style format string with optional arguments, as input and panics if err != nil.
True is the equivalent of Equal with a true value.
Truef is the equivalent of Equalf with a true value.
Try takes a function f() => x that may panic, and instead returns a function f() => (x, error).

# Variables

False is an alias of [Not].
Falsef is an alias of [Notf].

# Structs

CheckError is the type of error that may be returned by a check function such as [Check], [CheckAll], and [Checkf].
CompareError is the type of error that may be returned by a comparison function such as [True] or [Equal], or a formating variant of a comparison function (one ending in "f").
NeverError is the type of error that may be returned by [Never], and represents an event that should never happen.
OkError is the type of error that may be returned by [Ok] or [Okf].
ResultError is the type of error that may be returned by [Result] or [Resultf].
ValueError is the type of error that may hold a value, for example a non-error value recovered from a panic in [Try].