diff options
| author | 2026-03-07 00:38:50 +0800 | |
|---|---|---|
| committer | 2026-03-07 00:38:50 +0800 | |
| commit | 474bcba13eddb1ae2fb2fa6340f1c4064cdcf12f (patch) | |
| tree | 96e703836798d9a15e6159cda37f242fa3693f18 /ancestor | |
| parent | Urgh I made some wrong amends and I'm too tired to separate the commits out t... (diff) | |
| signature | No signature | |
*: Use errors.AsType
Diffstat (limited to 'ancestor')
| -rw-r--r-- | ancestor/integration_test.go | 4 | ||||
| -rw-r--r-- | ancestor/unit_test.go | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/ancestor/integration_test.go b/ancestor/integration_test.go index d13c86ed..fa630f57 100644 --- a/ancestor/integration_test.go +++ b/ancestor/integration_test.go @@ -112,8 +112,8 @@ func TestIsMissingObject(t *testing.T) { t.Fatal("expected error") } - var missing *giterrors.ObjectMissingError - if !errors.As(err, &missing) { + missing, ok := errors.AsType[*giterrors.ObjectMissingError](err) + if !ok { t.Fatalf("expected ObjectMissingError, got %T (%v)", err, err) } 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) } }) |
