-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters