Documentation
¶
Index ¶
- Variables
- func Assert(cond bool, err error)
- func Async[R any](ctx context.Context, fn func() R) (R, error)
- func CastInterfaces[T any, T2 any](slice ...T) []T2
- func Chan[R any](fn func() R) <-chan R
- func ConcatErrors(errs ...error) string
- func Flush[T any](c <-chan T) (i int)
- func LockContext(ctx context.Context, lock interface{ ... }) error
- func Must[T any](res T, err any) T
- func Or[T comparable](vals ...T) (t T)
- func Ptr[T any](t T) *T
- func ReadAll(ctx context.Context, r io.Reader, b []byte) ([]byte, error)
- func SignalContext(ctx context.Context, signals ...os.Signal) context.Context
- func Sleep(ctx context.Context, duration time.Duration) error
- func Slice[T ~[]E, E any](list T, start, end int) T
- func Throw(err any)
- func Timeout[T any](ctx context.Context, timeout time.Duration, ...) (T, error)
- func Try[T any](panicableFunc func() T) (res T, err any)
- func UnwrapAll(err error) []error
- func Variadic[T any](elems ...T) []T
- func Wrap(wrapper, original error) error
- func Zero[T any]() (z T)
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAssertionFailed = errors.New("assertion failed")
Functions ¶
func CastInterfaces ¶
func ConcatErrors ¶
func Or ¶
func Or[T comparable](vals ...T) (t T)
Types ¶
Click to show internal directories.
Click to hide internal directories.