diff --git a/equality.go b/equality.go index 0accea7..78ab85f 100644 --- a/equality.go +++ b/equality.go @@ -264,7 +264,7 @@ func interfaceHasNilValue(actual any) bool { func ShouldNotBeNil(actual any, expected ...any) string { if fail := need(0, expected); fail != success { return fail - } else if ShouldBeNil(actual) == success { + } else if actual == nil || interfaceHasNilValue(actual) { return fmt.Sprintf(shouldNotHaveBeenNil, actual) } return success