You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2021. It is now read-only.
func Annot(cause error, a ...interface{}) error
func Annotf(cause error, format string, a ...interface{}) error
In my opinion, Wrap() doesn't convey the purpose of the function as well as Annot() does. Finally, supporting variadics keeps things consistent with everything else.
The text was updated successfully, but these errors were encountered:
Thank you for your request. I don't plan to rename Wrap at this time as I've just told the world about the old name, and it would be very hard to reach all those people a now. Also, Wrap is shorter that Annot, which itself feels like a compromise spelling of Annotate.
I don't want to make Wrap variadic, as this would make it easy for people to write
cause := fn()
return errors.Wrap(fmt.Errorf("something bad happened in fn", err)
However Wrapf(cause error, format string, args ...interface{}) error sounds fine. Would you like to send a PR ?
davecheney
changed the title
Suggestion: rename Wrap() to Annot() and support variadics
Add Wrapf(cause error, format string, args ...interface{}) error
Apr 24, 2016
Instead of this
func Wrap(cause error, message string) error
Have these two
func Annot(cause error, a ...interface{}) error
func Annotf(cause error, format string, a ...interface{}) error
In my opinion, Wrap() doesn't convey the purpose of the function as well as Annot() does. Finally, supporting variadics keeps things consistent with everything else.
The text was updated successfully, but these errors were encountered: