aboutsummaryrefslogtreecommitdiff
path: root/reachability
diff options
context:
space:
mode:
Diffstat (limited to 'reachability')
-rw-r--r--reachability/integration_test.go4
-rw-r--r--reachability/unit_test.go8
-rw-r--r--reachability/walk_expand_commits_graph.go3
3 files changed, 7 insertions, 8 deletions
diff --git a/reachability/integration_test.go b/reachability/integration_test.go
index 6b043d92..feda699b 100644
--- a/reachability/integration_test.go
+++ b/reachability/integration_test.go
@@ -187,8 +187,8 @@ func TestCheckConnectedMissingObject(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/reachability/unit_test.go b/reachability/unit_test.go
index dea6d38b..1a2f4773 100644
--- a/reachability/unit_test.go
+++ b/reachability/unit_test.go
@@ -164,8 +164,8 @@ func TestWalkDomainCommitsRejectsNonCommitRootAfterPeel(t *testing.T) {
t.Fatal("expected error")
}
- var typeErr *giterrors.ObjectTypeError
- if !errors.As(err, &typeErr) {
+ typeErr, ok := errors.AsType[*giterrors.ObjectTypeError](err)
+ if !ok {
t.Fatalf("expected ObjectTypeError, got %T (%v)", err, err)
}
@@ -280,8 +280,8 @@ func TestCheckConnectedReturnsConcreteMissingObject(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/reachability/walk_expand_commits_graph.go b/reachability/walk_expand_commits_graph.go
index 90e52112..9602f35c 100644
--- a/reachability/walk_expand_commits_graph.go
+++ b/reachability/walk_expand_commits_graph.go
@@ -11,8 +11,7 @@ import (
func (walk *Walk) expandCommitsFromGraph(id objectid.ObjectID) ([]walkItem, bool, error) {
pos, err := walk.reachability.graph.Lookup(id)
if err != nil {
- var notFound *commitgraphread.NotFoundError
- if errors.As(err, &notFound) {
+ if _, ok := errors.AsType[*commitgraphread.NotFoundError](err); ok {
return nil, false, nil
}