Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano committed Aug 7, 2024
1 parent 7a81e00 commit 47dd81c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ func (e *Error) Error() string {
// if their error codes are identical
func (e *Error) Is(err error) bool {
// assert it can be casted
rosErr, ok := err.(*Error)
var rosErr *Error
ok := errors.As(err, &rosErr)
if rosErr == nil || !ok {
return false
}
Expand Down
3 changes: 1 addition & 2 deletions lib/errors/errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ func TestRegisterError(t *testing.T) {
registeredErrorsCount++
assert.Equal(t, len(ListErrors()), registeredErrorsCount)
// re-register an error should not change anything
err = RegisterError(69, "nice!", false, "nice!")
assert.NoError(t, err)
_ = RegisterError(69, "nice!", false, "nice!")
assert.Equal(t, len(ListErrors()), registeredErrorsCount)

// test sealing
Expand Down

0 comments on commit 47dd81c

Please sign in to comment.