Skip to content
This repository was archived by the owner on Oct 14, 2021. It is now read-only.

fix: Use errors.Is to assert error's type #28

Merged
merged 1 commit into from
Jul 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions mover.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tests
import (
"bytes"
"crypto/md5"
"errors"
"io"
"io/ioutil"
"math/rand"
Expand Down Expand Up @@ -60,7 +61,7 @@ func TestMover(t *testing.T, store types.Storager) {
_, err := store.Stat(src)

Convey("The error should be ErrObjectNotExist", func() {
So(err, ShouldEqual, services.ErrObjectNotExist)
So(errors.Is(err, services.ErrObjectNotExist), ShouldBeTrue)
})
})

Expand Down Expand Up @@ -121,7 +122,7 @@ func TestMover(t *testing.T, store types.Storager) {
_, err := store.Stat(src)

Convey("The error should be ErrObjectNotExist", func() {
So(err, ShouldEqual, services.ErrObjectNotExist)
So(errors.Is(err, services.ErrObjectNotExist), ShouldBeTrue)
})
})

Expand Down