Skip to content

Commit

Permalink
docs: fix typo and improve consistency of comment for Error.Unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieEdge committed Dec 24, 2022
1 parent affbf8f commit 2d06845
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ func (e Error) As(target interface{}) bool {
}

/*
Unwrap the last error for compatible with the `errors.Unwrap()`
when you need unwrap all erros, you should use `WrappedErrors()` instead
Unwrap the last error for compatibility with `errors.Unwrap()`.
When you need to unwrap all errors, you should use `WrappedErrors()` instead.
err := Do(
func() error {
Expand All @@ -240,7 +240,7 @@ when you need unwrap all erros, you should use `WrappedErrors()` instead
fmt.Println(errors.Unwrap(err)) # "original error" is printed
added in version 4.2.0
Added in version 4.2.0.
*/
func (e Error) Unwrap() error {
return e[len(e)-1]
Expand Down

0 comments on commit 2d06845

Please sign in to comment.