errors
Simple error handling primitives (by pkg)
go-multierror
A Go (golang) package for representing a list of errors as a single error. (by hashicorp)
Our great sponsors
errors | go-multierror | |
---|---|---|
30 | 16 | |
7,511 | 2,177 | |
- | 1.3% | |
0.2 | 4.8 | |
over 2 years ago | 24 days ago | |
Go | Go | |
BSD 2-clause "Simplified" License | Mozilla Public License 2.0 |
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.
errors
Posts with mentions or reviews of errors.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-11-29.
-
Show HN: Error return traces for Go, inspired by Zig
Can you explain why we should this over https://github.com/pkg/errors?
-
Cant wait for less verbose error handling
The pkg/errors package offers some nice add-ons for easier error handling. Too bad it was put into maintenance mode pending whatever changes/improvements are coming in Go 2.
- Error handling and serializing
-
isse for go path in neovim
I can't figure out the issue so here for some help, I am using `neovim/nvim-lspconfig` my `gopls` doesn't recognise external paths such as `github.com/pkg/errors` , it throws error`could not import github.com/pkg/errors (cannot find package "github.com/pkg/errors" in any of /usr/local/go/src/github.com/pkg/errors (from $GOROOT) /Users/ra compiler (BrokenImport)\`
-
What am I supposed to be doing with errors?
Also - there are some error handling utils that allow you to wrap errors before passing: https://github.com/pkg/errors
-
Go error handling is not verbose but the error handling itself.
Should've been something like errors.Newf("failed to foofoo %s", foo) instead and preferably never invent %w but have some controlled way to wrap like errors.Wrapf(err, "failed to foofoo %s", foo) that was in ye olde github.com/pkg/errors.
-
How to wrap the error best?
Prefer using errors.Wrap and errors.Wrapf from https://github.com/pkg/errors . It's frozen because they don't want to add features, waiting for a re-write of error handling in Go2.
- mdobak/go-xerrors: Yet another error handling library.
-
Getting at the type of error after it has been wrapped with errors.Wrap
Im using zerolog and in order to get the stack trace for my error I have to wrap my error in errors.Wrap from "github.com/pkg/errors".
-
When ia a good time to panic?
And for "real programs" you can use https://github.com/pkg/errors (if you want stack traces)
go-multierror
Posts with mentions or reviews of go-multierror.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2023-05-18.
-
In what ways are channels are better than the traditional await?
Some packages offer utilities to gather results from goroutines, such as multierror.Group or parallel.Map in samber/lo.
-
ResultGroup: Go lib for concurrent tasks & errors management
I've created a simple Go library for managing concurrent tasks, results, and errors. Inspired by HashiCorp's go-multierror, it simplifies running goroutines, collecting results, and error handling by minimizing boilerplate code.
-
Valgo is a type-safe, expressive, and extensible validator library for Golang.
This looks great and can be integrated into ORM. What about adopting go-multierror?
- Multiple error wrapping is coming in Go 1.20
- mdobak/go-xerrors: Yet another error handling library.
-
Multiple error handling in Go
Unlike errgroup, github.com/hashicorp/go-multierror cannot be interrupted by context. However, it is useful for use cases where you need to check all errors and handle them carefully, because you can keep all errors.
- A simple and easy-to-use batch error implementation.
- Better error handling in Golang: Theory and practical tips
-
SimpleFlow - Simplified generic workflows and concurrency patterns
I found that it was also useful to introduce https://github.com/hashicorp/go-multierror so if one or more single work items returns an error, we can also batch the errors as a single thing.
- If you absolutely must create a generic Optional…
What are some alternatives?
When comparing errors and go-multierror you can also consider the following projects:
zerolog - Zero Allocation JSON Logger
multierr - Combine one or more Go errors together
autoflags - Populate go command line app flags from config struct
go-chat-bot - IRC, Slack, Telegram and RocketChat bot written in go
logrus - Structured, pluggable logging for Go.
errorx - A comprehensive error handling library for Go
bitio - Optimized bit-level Reader and Writer for Go.
conv - Fast conversions across various Go types with a simple API.
Testify - A toolkit with common assertions and mocks that plays nicely with the standard library
werr
uuid - Generate, encode, and decode UUIDs v1 with fast or cryptographic-quality random node identifier.
health - An easy to use, extensible health check library for Go applications.