commit | 445999037311d4b33da9ece1730660e666862821 | [log] [tgz] |
---|---|---|
author | Alexandr Burdiyan <burdiyan@gmail.com> | Tue Sep 06 18:20:06 2022 +0200 |
committer | GitHub <noreply@github.com> | Tue Sep 06 09:20:06 2022 -0700 |
tree | faaf256b03dfc022de37569bb8c7262f0ad4a8b6 | |
parent | 80b07a745f5713f11d24360b1e0863eef98ac842 [diff] |
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>
multierr
allows combining one or more Go error
s together.
go get -u go.uber.org/multierr
Stable: No breaking changes will be made before 2.0.
Released under the MIT License.