Skip to content
This repository was archived by the owner on Dec 1, 2021. It is now read-only.

Commit 936b5d7

Browse files
matryerdavecheney
authored andcommitted
renamed cause argument to err - fixes #32 (#33)
1 parent e8c2198 commit 936b5d7

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

errors.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,22 @@ func Errorf(format string, args ...interface{}) error {
102102
}
103103
}
104104

105-
// Wrap returns an error annotating the cause with message.
106-
// If cause is nil, Wrap returns nil.
107-
func Wrap(cause error, message string) error {
108-
if cause == nil {
105+
// Wrap returns an error annotating err with message.
106+
// If err is nil, Wrap returns nil.
107+
func Wrap(err error, message string) error {
108+
if err == nil {
109109
return nil
110110
}
111-
return wrap(cause, message, callers())
111+
return wrap(err, message, callers())
112112
}
113113

114-
// Wrapf returns an error annotating the cause with the format specifier.
115-
// If cause is nil, Wrapf returns nil.
116-
func Wrapf(cause error, format string, args ...interface{}) error {
117-
if cause == nil {
114+
// Wrapf returns an error annotating err with the format specifier.
115+
// If err is nil, Wrapf returns nil.
116+
func Wrapf(err error, format string, args ...interface{}) error {
117+
if err == nil {
118118
return nil
119119
}
120-
return wrap(cause, fmt.Sprintf(format, args...), callers())
120+
return wrap(err, fmt.Sprintf(format, args...), callers())
121121
}
122122

123123
func wrap(err error, msg string, st *stack) error {

0 commit comments

Comments
 (0)