Skip to content
/ errs Public

convenience wrapper for chaining multiple error returning functions.

License

Notifications You must be signed in to change notification settings

abiosoft/errs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

convenience wrapper for chaining multiple error returning functions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages