must

package
v0.0.0-alpha.0...-306d899 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package must provides configured error response for functions that must complete without error.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(err error)

func Do receives an error and handles it or not.

Usage:
must.Do(Something()) // reports error if Something() fails.
datum,err := LoadStuff()
must.Do(err) // reports error if LoadStuff() fails.

func SetMethod

func SetMethod(x int)

SetMethod receives an int, sets opt.method, clears opt.er.

func SetReporter

func SetReporter(er ErrorReporter)

SetReporter receives an ErrorReporter, sets opt.er.

Types

type ErrorReporter

type ErrorReporter interface {
	Report(error)
}

interface ErrorReporter implements the func Report(error). A user defined ErrorReporter may be used by this package.

Jump to

Keyboard shortcuts

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