From f53e45d3132c64e6632b739d863b3a563e6e171b Mon Sep 17 00:00:00 2001 From: mooncake9527 Date: Tue, 24 Sep 2024 18:01:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xerrors/xerror/xerror_api_stack.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xerrors/xerror/xerror_api_stack.go b/xerrors/xerror/xerror_api_stack.go index 1a8dd21..7483348 100644 --- a/xerrors/xerror/xerror_api_stack.go +++ b/xerrors/xerror/xerror_api_stack.go @@ -1,6 +1,7 @@ package xerror import ( + "errors" "runtime" ) @@ -90,6 +91,9 @@ func Is(err, target error) bool { if err.Error() == target.Error() { return true } + if errors.Is(err, target) { + return true + } if e, ok := err.(IIs); ok { return e.Is(target) }