go-xerrors
The go-xerrors is an idiomatic and lightweight package that provides a set of functions to make working with errors easier. (by MDobak)
multierr
Combine one or more Go errors together (by uber-go)
go-xerrors | multierr | |
---|---|---|
1 | 4 | |
33 | 911 | |
- | 1.1% | |
10.0 | 3.8 | |
over 1 year ago | 7 months ago | |
Go | Go | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
go-xerrors
Posts with mentions or reviews of go-xerrors.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-09-30.
multierr
Posts with mentions or reviews of multierr.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-11-29.
-
Multiple error wrapping is coming in Go 1.20
The only remaining use-case I see here looks like https://github.com/uber-go/multierr , maybe useful in concurrent scenarios. But on my side this is rather anecdotical, and anyway already addressed by a well documented and tested third party.
- mdobak/go-xerrors: Yet another error handling library.
- Better error handling in Golang: Theory and practical tips
-
Return multiple dependent errors in Go?
There are a few libraries that solve this problem. One is https://github.com/uber-go/multierr , another https://github.com/hashicorp/go-multierror . They have similar APIs and are pretty easy to use. If you don't want to import another library, it's pretty easy to do something similar yourself, inspired by them. 😊
What are some alternatives?
When comparing go-xerrors and multierr you can also consider the following projects:
errors - Simple error handling primitives
go-multierror - A Go (golang) package for representing a list of errors as a single error.
errors - clear go error wrapping with caller
go - The Go programming language
eris - Error handling library with readable stack traces and flexible formatting support 🎆