Documentation ¶
Overview ¶
Package errors provides grouped errors.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var New = errors.New
New creates a new error
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group defines a set errors
func NewGroup ¶
NewGroup given a prefix will return an Group with the given prefix. Group formats errors like so;
{prefix}: {err msg}
Example ¶
g := NewGroup("group1").Add( NewGroup("group2").Add( NewGroup("group3").Add(New("group before this")).Add(New("space before this")).Add(New(`space before this carriage return before this`)), ).New(`group before this carriage return before this carriage return before this carriage return before this `), ) fmt.Println(g.Error())
Output: group1: group2: group3: group before this space before this space before this ⮎ carriage return before this group1: group2: group before this ⮎ carriage return before this ⮎ carriage return before this ⮎ carriage return before this
func (*Group) Errored ¶
Errored returns true if an error has been added and false if no errors have been added.
Click to show internal directories.
Click to hide internal directories.