Add AppendInto function (#31)

This adds an AppendInto function that behaves similarly to Append
except, it operates on a `*error` on the left side and it reports
whether the right side error was non-nil.

    func AppendInto(*error, error) (errored bool)

Making the left side a pointer aligns with the fast path of `Append`.

Returning whether the right error was non-nil aligns with the standard
`if err := ...; err != nil` pattern.

```diff
-if err := thing(); err != nil {
+if multierr.AppendInto(&err, thing()) {
   continue
 }
```

Resolves #21
4 files changed
tree: c590d014235c41a76b3c367f1ec49aa19dab0abe
  1. .codecov.yml
  2. .gitignore
  3. .travis.yml
  4. benchmarks_test.go
  5. CHANGELOG.md
  6. error.go
  7. error_test.go
  8. example_test.go
  9. glide.yaml
  10. go.mod
  11. go.sum
  12. go113.go
  13. go113_test.go
  14. LICENSE.txt
  15. Makefile
  16. README.md
  17. tools.go
README.md

multierr GoDoc Build Status Coverage Status

multierr allows combining one or more Go errors together.

Installation

go get -u go.uber.org/multierr

Status

Stable: No breaking changes will be made before 2.0.


Released under the MIT License.