diff options
Diffstat (limited to 'src/errors')
| -rw-r--r-- | src/errors/wrap.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/errors/wrap.go b/src/errors/wrap.go index 4eb4f9ae37..b73d5a8ce2 100644 --- a/src/errors/wrap.go +++ b/src/errors/wrap.go @@ -35,7 +35,8 @@ func Unwrap(err error) error { // func (m MyError) Is(target error) bool { return target == fs.ErrExist } // // then Is(MyError{}, fs.ErrExist) returns true. See syscall.Errno.Is for -// an example in the standard library. +// an example in the standard library. An Is method should only shallowly +// compare err and the target and not call Unwrap on either. func Is(err, target error) bool { if target == nil { return err == target |
