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 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.
Click to show internal directories.
Click to hide internal directories.