Documentation
¶
Overview ¶
Package warnings implements error handling with non-fatal errors (warnings).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FatalOnly ¶
FatalOnly returns the fatal error, if any, **in an error returned by a Collector**. It returns nil if and only if err is nil or err is a List with err.Fatal == nil.
func WarningsOnly ¶
WarningsOnly returns the warnings **in an error returned by a Collector**.
Types ¶
type Collector ¶
type Collector struct {
// IsFatal distinguishes between warnings and fatal errors.
IsFatal func(error) bool
// FatalWithWarnings set to true means that a fatal error is returned as
// a List together with all warnings so far. The default behavior is to
// only return the fatal error and discard any warnings that have been
// collected.
FatalWithWarnings bool
// contains filtered or unexported fields
}
A Collector collects errors up to the first fatal error.
func NewCollector ¶
NewCollector returs a new Collector; it uses isFatal to distinguish between warnings and fatal errors.
Click to show internal directories.
Click to hide internal directories.