Skip to content

Commit 74f58ff

Browse files
committed
Wrong errors.Is sample
1 parent 5ddb751 commit 74f58ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ notExist := try.Is(r2.err, plugin.ErrNotExist)
242242
**Note.** Any other error than `plugin.ErrNotExist` is treated as an real error:
243243
1. `try.Is` function first checks `if err == nil`, and if yes, it returns
244244
`false`.
245-
2. Then it checks if `errors.Is` == `plugin.ErrNotExist` and if yes, it returns
245+
2. Then it checks if `errors.Is(err, plugin.ErrNotExist)` and if yes, it returns
246246
`true`.
247247
3. Finally, it calls `try.To` for the non nil error, and we already know what then
248248
happens: nearest `err2.Handle` gets it first.

0 commit comments

Comments
 (0)