Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure checks for an error. If there is one it panics, if no error it prints the message (given it is not empty) `message` should describe what is ensured by the call and verification of `err` being `nil`
func LogIfError ¶
func LogIfError(err error)
LogIfError logs an error if it occurs, rather than repeating this structure everywhere
func PanicIfErr ¶
PanicIfErr panics in case of an error. If custom message it creates a new error based on that and returns that instead
func ReturnErrOnPanic ¶
func ReturnErrOnPanic(perr *error) func()
ReturnErrOnPanic catches panics, expects them to be of type error, then stores it in the pointer as recovery
func ReturnFirstErr ¶
ReturnFirstErr returns the first not-nil error from a list of errors. Used to prevent many copies of if err != nil { return err } when they are indepedent
Types ¶
This section is empty.