Replace errors.Cause() with errors.Is()
Dependencies may be switching to use the new `%w` formatting option to wrap errors; switching to use `errors.Is()` makes sure that we are still able to unwrap the error and detect the underlying cause. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -88,6 +88,9 @@ func TestGRPCRoundTrip(t *testing.T) {
|
||||
if errors.Cause(ferr) != testcase.cause {
|
||||
t.Fatalf("unexpected cause: %v != %v", errors.Cause(ferr), testcase.cause)
|
||||
}
|
||||
if !errors.Is(ferr, testcase.cause) {
|
||||
t.Fatalf("unexpected cause: !errors.Is(%v, %v)", ferr, testcase.cause)
|
||||
}
|
||||
|
||||
expected := testcase.str
|
||||
if expected == "" {
|
||||
|
Reference in New Issue
Block a user