Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 608 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 608 Bytes

errs

convenience wrapper for chaining multiple error returning functions when you do not need to handle the errors separately.

Documentation

Usage

var e errs.Group

// add couple of functions
e.Add(func() error { ... })
e.Defer(func() { ... }) // executes after other functions
e.Add(func() error { ... })
e.Add(func() error { ... })
e.Final(func() { ... }) // executes even if error is returned

// execute them
if err := e.Exec(); err != nil {
    // handle error
}