Expected: 'fn:not here'
Actual: ''
(Should be equal)
**Expected behavior**
Pass all tests
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Mockey version:**
v1.2.2
**Environment:**
The output of `go env`.
go version go1.14.13 darwin/amd64
go version go1.15.6 darwin/amd64
**Additional Info:**
This is may because the target function is too stort in go 1.15 and lower. When change code above to shown below, the test will pass:
```diff
func TestXxx(t *testing.T) {
PatchConvey("xxx", t, func() {
fn := func(i int) string {
+ fmt.Println()
return "fn:not here"
}
Mock(fn).When(func(i int) bool { return i > 0 && i < 3 }).To(func(i int) string {
panic("to:not here")
}).Build()
So(fn(0), ShouldEqual, "fn:not here")
})
}
Describe the bug
Short functions not run properly when fallback to original function call in go1.15 or lower env.
To Reproduce
Steps to reproduce the behavior:
Expected: 'fn:not here' Actual: '' (Should be equal)