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:
Sebastiaan van Stijn
2020-05-08 01:03:26 +02:00
parent 834f58bd0c
commit dc92ad6520
25 changed files with 51 additions and 50 deletions

View File

@@ -80,7 +80,7 @@ func TestPoolMetadata_AddDeviceDuplicate(t *testing.T) {
assert.NilError(t, err)
err = store.AddDevice(testCtx, &DeviceInfo{Name: "test"})
assert.Equal(t, ErrAlreadyExists, errors.Cause(err))
assert.Assert(t, errors.Is(err, ErrAlreadyExists))
}
func TestPoolMetadata_ReuseDeviceID(t *testing.T) {