Documentation ¶
Overview ¶
Package multierror contains code to manage multiple errors.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Union ¶
type Union struct { // Children contains the underlying errors. Children []error // Root is the root error. Root error }
Union is the logical union of several errors. The Union will appear to be the Root error, except that it will actually be possible to look deeper and see specific child errors that occurred using errors.As and errors.Is.
Example ¶
package main import ( "errors" "fmt" "github.com/ooni/probe-cli/v3/internal/multierror" ) func main() { root := errors.New("some error") me := multierror.New(root) check := errors.Is(me, root) fmt.Printf("%+v\n", check) }
Output: true
func (*Union) AddWithPrefix ¶
AddWithPrefix adds the specified child error to the Union error with the specified prefix before the child error.
Click to show internal directories.
Click to hide internal directories.