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. CHANGELOG.md
  5. LICENSE.txt
  6. Makefile
  7. README.md
  8. benchmarks_test.go
  9. error.go
  10. error_test.go
  11. example_test.go
  12. glide.yaml
  13. go.mod
  14. go.sum
  15. go113.go
  16. go113_test.go
  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.