Skip to content

Commit 0bdb1ce

Browse files
committed
fix xerrors
1 parent 9caaf49 commit 0bdb1ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ changes that can be applied into Dave Cheney library. We want to offer one way t
1313
errors, but with the minimum refactor, for that we've created this package.
1414

1515
This package provide the same interface that the original library have, but using new [go 1.13](https://godoc.org/errors)
16-
errors.
16+
errors, or in previous version [golang.org/x/xerrors](https://golang.org/x/xerrors) package.
1717

1818
## How to start using friendsofgo/errors
1919

@@ -92,7 +92,8 @@ if errors.Is(err, ErrMyError) {
9292
```
9393

9494
## Disclaimer
95-
This package is only compatible from go1.13 onwards.
95+
This package was created to using with go 1.13 version however if you uses this package with a previous version, the methods
96+
`As`, `Is`, `Wrap` and `Wrapf` will be using [golang.org/x/xerrors](https://golang.org/x/xerrors) package.
9697

9798
## Contributing
9899

xerrors.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
package errors
121121

122122
import (
123-
"errors"
124123
"fmt"
125124
"io"
126125

@@ -325,7 +324,7 @@ func Cause(err error) error {
325324

326325
for err != nil {
327326
var c causer
328-
if !errors.As(err, &c) {
327+
if !As(err, &c) {
329328
break
330329
}
331330
err = c.Cause()

0 commit comments

Comments
 (0)