From 474bcba13eddb1ae2fb2fa6340f1c4064cdcf12f Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 7 Mar 2026 00:38:50 +0800 Subject: *: Use errors.AsType --- ancestor/unit_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ancestor/unit_test.go') diff --git a/ancestor/unit_test.go b/ancestor/unit_test.go index 827aeb8f..b6ca7b58 100644 --- a/ancestor/unit_test.go +++ b/ancestor/unit_test.go @@ -110,8 +110,7 @@ func TestIsRejectsNonCommitAfterPeel(t *testing.T) { t.Fatal("expected error") } - var typeErr *giterrors.ObjectTypeError - if !errors.As(err, &typeErr) { + if _, ok := errors.AsType[*giterrors.ObjectTypeError](err); !ok { t.Fatalf("expected ObjectTypeError, got %T (%v)", err, err) } }) -- cgit v1.3.1-10-gc9f91