Changed a syntax error to valid Go code

Agniva De Sarker 2019-03-19 11:13:48 +05:30
parent 7c8842f897
commit 6ce7a0f8c2

@ -26,7 +26,8 @@ You need to be prepared that errors you get may be wrapped.
```
becomes
```
if e := &os.PathError{}; xerrors.As(err, &e)
e := &os.PathError{}
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.)
- Rewrite a type switch as a sequence of if-elses.