die

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: ISC Imports: 2 Imported by: 0

README

Simple fatal utilities for Go programs.

	result, err := doSomething()
	die.If(err)

	ok := processResult(result)
	if !ok {
		die.With("failed to process result %s", result.Name)
	}

Documentation

Overview

Package die contains utilities for fatal error handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func If

func If(err error)

If prints the error to stderr and exits if err != nil.

func When

func When(cond bool, fstr string, args ...interface{})

When prints the error to stderr and exits if cond is true.

func With

func With(fstr string, args ...interface{})

With prints the message to stderr, appending a newline, and exits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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