diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-12-03 12:34:04 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-12-06 09:50:56 +0300 |
commit | ee9d0bec3bc62890f8c38b3b5bf1535b338c8bd3 (patch) | |
tree | 27ee00736acd2e8463287e69d01fcbb44672e8e2 | |
parent | 4cacba036ead2988678c861d741f6110a15be551 (diff) |
testhelper: Remove unused `ContainsGrpcError()` function
The helper function `ContainsGrpcError()` isn't used anymore. Remove it.
-rw-r--r-- | internal/testhelper/grpc.go | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/internal/testhelper/grpc.go b/internal/testhelper/grpc.go index fa3c8fe3c..536894d16 100644 --- a/internal/testhelper/grpc.go +++ b/internal/testhelper/grpc.go @@ -2,7 +2,6 @@ package testhelper import ( "context" - "fmt" "testing" "github.com/google/go-cmp/cmp" @@ -59,18 +58,6 @@ func RequireGrpcError(t testing.TB, expected, actual error) { ProtoEqual(t, status.Convert(expected).Proto(), status.Convert(actual).Proto()) } -// ContainsGrpcError checks that an equal gRPC error is present in the slice of errors. -func ContainsGrpcError(t testing.TB, errs []error, err error) { - t.Helper() - errStatus := status.Convert(err).Proto() - for _, e := range errs { - if cmp.Equal(status.Convert(e).Proto(), errStatus, protocmp.Transform()) { - return - } - } - require.FailNow(t, fmt.Sprintf("%#v does not contain %#v", errs, err)) -} - // MergeOutgoingMetadata merges provided metadata-s and returns context with resulting value. func MergeOutgoingMetadata(ctx context.Context, md ...metadata.MD) context.Context { ctxmd, ok := metadata.FromOutgoingContext(ctx) |