From d6a720b95ec8150620214ee5b0b2af50beb36900 Mon Sep 17 00:00:00 2001 From: Artur Mechetin <37845382+archi144@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:23:37 +0300 Subject: [PATCH] fix: use Is to check err values --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 765ed59..6d0d668 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1178,7 +1178,7 @@ When handling an error, we can decide to wrap it. Wrapping is about adding addit ???+ info "TL;DR" - If you use Go 1.13 error wrapping with the `%w` directive and `fmt.Errorf`, comparing an error against or a value has to be done using `errors.As`. Otherwise, if the returned error you want to check is wrapped, it will fail the checks. + If you use Go 1.13 error wrapping with the `%w` directive and `fmt.Errorf`, comparing an error against or a value has to be done using `errors.Is`. Otherwise, if the returned error you want to check is wrapped, it will fail the checks. A sentinel error is an error defined as a global variable: