Skip to content

Commit

Permalink
ShouldNotBeNil doesn't rely on ShouldBeNil
Browse files Browse the repository at this point in the history
  • Loading branch information
ale7714 committed Oct 8, 2024
1 parent 6ce915b commit b773e65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion equality.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b773e65

Please sign in to comment.