must

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeQuiet

func BeQuiet() func()

BeQuiet sets stdout, stderr and the logger to null and returns a function to revert to the former values

func CheckLock

func CheckLock(report func(traces gotrace.Traces)) func()

CheckLock let's us ctrl-c (or KILL) and we get a stacktrace of where it was at that moment good for checking deadlocks or running with long timeouts

func Ignore

func Ignore(_ error)

Ignore ignores the error code

func Ok

func Ok(err error)

Must error must be not nil

func OkOne

func OkOne[T any](arg T, err error) T

OkOne error must be not nil and returns one value

func OkSkipOne

func OkSkipOne[T any](_ T, err error)

OkSkipOne error must be not nil and skips one additional return value

func OkSkipTwo

func OkSkipTwo[T any, S any](_ T, _ S, err error)

OkSkipTwo error must be not nil and skips two additional return values

func OkTwo

func OkTwo[T any, S any](arg1 T, arg2 S, err error) (T, S)

OkTwo error must be not nil and returns two values

func Protect

func Protect(run func(), reportPanic func(any))

Protect is used to catch panics

Types

This section is empty.

Jump to

Keyboard shortcuts

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