chore: Drop support for Go < 1.20 (#80)

Drops support for versions of Go older than 1.20.
With 1.20 being the minimum supported Go version,
we can remove the pre_go120 code, and merge the post_go120 code.

With Go 1.20's multi-error interface, our errorGroup interface
is not necessary, but we need it for backwards compatibility.
Also updates the documentation to suggest Go 1.20's interface
instead of ours.
The `Errors() []error` function is now an implementation detail.
8 files changed
tree: 86d383166461ad862a8243d41c0825bd18f3d096
  1. .github/
  2. tools/
  3. .codecov.yml
  4. .gitignore
  5. appendinvoke_example_test.go
  6. benchmarks_test.go
  7. CHANGELOG.md
  8. error.go
  9. error_ext_test.go
  10. error_test.go
  11. example_test.go
  12. go.mod
  13. go.sum
  14. LICENSE.txt
  15. Makefile
  16. README.md
README.md

multierr GoDoc Build Status Coverage Status

multierr allows combining one or more Go errors together.

Features

  • Idiomatic: multierr follows best practices in Go, and keeps your code idiomatic.
    • It keeps the underlying error type hidden, allowing you to deal in error values exclusively.
    • It provides APIs to safely append into an error from a defer statement.
  • Performant: multierr is optimized for performance:
    • It avoids allocations where possible.
    • It utilizes slice resizing semantics to optimize common cases like appending into the same error object from a loop.
  • Interoperable: multierr interoperates with the Go standard library's error APIs seamlessly:
    • The errors.Is and errors.As functions just work.
  • Lightweight: multierr comes with virtually no dependencies.

Installation

go get -u go.uber.org/multierr@latest

Status

Stable: No breaking changes will be made before 2.0.


Released under the MIT License.