Closed KevinAnthony closed 1 year ago
Good catch. The spec is pretty clear in stating that:
Slice, map, and function types are not comparable (with
==
). However, as a special case, a slice, map, or function value may be compared to the predeclared identifier nil.
Furthermore, reflect.DeepEqual
won't even return true
in the case that a nil func reference is compared with nil
: https://go.dev/play/p/9DRZia53nFk
So, I'm trying to see the utility of supporting equality comparisons with ShouldEqual
. Just curious, why are you comparing functions with ShouldEqual
?
Interface implementation testing.
We have an interface that has a function, "GetHandler()" that returns the handler that was set on initialization.
This unit test ensures that the function passed into the struct isn't mutated, and is instead the same function that is passed back out"
@KevinAnthony - Pull v1.15.1 and see if that does the trick.
I know this is closed, but I wanted to update it and say it worked for us.
can you look at this PR in goconvey https://github.com/smartystreets/goconvey/pull/676 To update this bug in goconvey?
Starting in 1.15.0
ShouldEqual
no longer functions properly.This panics with:
This work in 1.13.1