https://github.com/abiosoft/errs
convenience wrapper for chaining multiple error returning functions.
https://github.com/abiosoft/errs
error-group errors go group
Last synced: 1 day ago
JSON representation
convenience wrapper for chaining multiple error returning functions.
- Host: GitHub
- URL: https://github.com/abiosoft/errs
- Owner: abiosoft
- License: mit
- Created: 2017-05-18T09:02:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-29T10:42:16.000Z (about 7 years ago)
- Last Synced: 2025-10-04T06:59:12.941Z (1 day ago)
- Topics: error-group, errors, go, group
- Language: Go
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# errs
convenience wrapper for chaining multiple error returning functions _when you do not need to handle the errors separately_.[](https://godoc.org/github.com/abiosoft/errs)
## Usage
```go
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
}
```