Documentation
¶
Overview ¶
Package must provides functions for handling errors and panics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ok ¶
Ok takes a function that returns a value and error and returns only a value, otherwise it panics.
func Recover ¶
func Recover(errs ...error)
Recover can be used to recover from panics within a function. It must be called with defer where the panic occurs. If errors are provided, Recover will only recover from panics that match one of the errors. If no errors are provided, then all panics will be recovered and logged using the default slog logger.
func RecoverFunc ¶
RecoverFunc allows recovering a panic within a function. If the function provided returns true, then the panic is recovered, otherwise panic is called with the original recovered value.
Types ¶
This section is empty.