Add a shorthand for AppendInvoke (#65)

I really like the idea of catching returned errors from deferred functions. Though having to use `multierr` package name twice in the same line makes it a bit verbose in many occasions.

This PR introduces a shorthand for AppendInvoke which allows passing function or method value directly without wrapping it into an Invoker.

So this:

```go
defer multierr.AppendInvoke(&err, multierr.Invoke(my.StopFunc))
```

could become this:

```go
defer multierr.AppendFunc(&err, my.StopFunc)
```

Co-authored-by: Sung Yoon Whang <sungyoonwhang@gmail.com>
2 files changed
tree: faaf256b03dfc022de37569bb8c7262f0ad4a8b6
  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. glide.yaml
  13. go.mod
  14. go.sum
  15. LICENSE.txt
  16. Makefile
  17. README.md
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.