die

package
v0.0.0-...-c4aabd3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnErr

func OnErr(fn func() error, mm ...string)

OnErr is a helper function to handle errors, that runs the given function and, in case of error, it prints the error message and exits (1) the program.

func OrRet

func OrRet[T any](fn func() (T, error), mm ...string) (t T)

OrRet is a helper function to handle errors, that runs the given function and, in case of error, it prints the error message and exits (1) the program. It is similar to OnErr, but in case of success it returns the value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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