doa

package module
v0.1.4-0...-4348896 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 0 Imported by: 0

README

Doa

Package doa is the abbreviation of the "Dead or alive". It provides some easy ways to make you panic down the program.

One of the benefits of detecting problems as soon as you can is that you can crash earlier, and crashing is often the bet thing you can do. The alternative may be to continue, writing corrupted data to some vital database or commanding the washing machine into its twentieth consecutive spin cycle.

Crash is not poison, it's "Quit gracefully".

Doc: https://godoc.org/github.com/mohanson/doa

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Doa

func Doa(b bool)

Doa lets you test if a condition in your code returns true, if not, the program will panic.

func Err

func Err[T any](a T, err error) error

Err just returns error.

func Nil

func Nil(err error)

Nil lets you test if an error in your code is nil, if not, the program will panic.

func Try

func Try[T any](a T, err error) T

Try will give you the embedded value if there is no error returns. If instead error then it will panic.

Types

This section is empty.

Jump to

Keyboard shortcuts

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