Combine one or more Go errors together
Go to file
Jacob Oaks cf4b2327ce
CI: Test against go 1.22 (#81)
Upgrades CI workflows to use Go versions 1.21 and 1.22.

Leave `go.mod` the same to avoid forcing upgrade beyond 1.20 for users.
2024-04-29 15:14:36 -04:00
.github/workflows CI: Test against go 1.22 (#81) 2024-04-29 15:14:36 -04:00
tools chore: Drop support for Go < 1.20 (#80) 2023-10-11 14:46:30 -04:00
.codecov.yml Use codecov instead of coveralls (#13) 2017-06-09 09:55:19 -07:00
.gitignore Switch to Go modules (#27) 2019-10-29 14:20:40 -07:00
CHANGELOG.md Release v1.11.0 (#79) 2023-03-29 16:00:37 -07:00
LICENSE.txt Update license headers everywhere 2021-05-06 10:23:05 -07:00
Makefile Use GitHub workflows 2021-05-06 10:24:39 -07:00
README.md README: Add Features section (#73) 2023-02-14 22:36:18 -08:00
appendinvoke_example_test.go Test and lint against Go 1.19 (#62) 2022-08-12 09:14:35 -07:00
benchmarks_test.go Combine: Optimize for all nil (#55) 2022-02-28 12:01:14 -08:00
error.go chore: Drop support for Go < 1.20 (#80) 2023-10-11 14:46:30 -04:00
error_ext_test.go Drop Go 1.12 support (#41) 2020-10-27 15:00:01 -07:00
error_test.go chore: Drop support for Go < 1.20 (#80) 2023-10-11 14:46:30 -04:00
example_test.go Update license headers everywhere 2021-05-06 10:23:05 -07:00
go.mod chore: Drop support for Go < 1.20 (#80) 2023-10-11 14:46:30 -04:00
go.sum Drop external atomic dependency (#72) 2023-02-14 22:35:24 -08:00

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.