mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
Updated ErrorValueFAQ (markdown)
parent
cf2a316722
commit
474d3c911e
@ -26,7 +26,7 @@ You need to be prepared that errors you get may be wrapped.
|
|||||||
```
|
```
|
||||||
becomes
|
becomes
|
||||||
```
|
```
|
||||||
e := &os.PathError{}
|
var e *s.PathError
|
||||||
if xerrors.As(err, &e)
|
if xerrors.As(err, &e)
|
||||||
```
|
```
|
||||||
- Also use this pattern to check whether an error implements an interface. (This is one of those rare cases when a pointer to an interface is appropriate.)
|
- Also use this pattern to check whether an error implements an interface. (This is one of those rare cases when a pointer to an interface is appropriate.)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user