I recently upgraded go monkey to github.com/agiledragon/gomonkey/v2 v2.2.0.
There is a test used to be working fine but is failing.
{
patch := gomonkey.NewPatches()
defer patch.Reset()
patch.ApplyFunc(xxfunc, func(_ context.Context, req model.XxReq) model.XxResult {
return &model.XxResult{
ErrCode: 0,
Message: &model.Message{
Message: model.PASS,
},
}
})
}
I am getting error message like the following:
target type(func(context.Context, model.XxReq, ...callopt.Option) model.XxResult) and double type(func(context.Context, model.XxReq) *model.XxResult) are different [recovered]
I recently upgraded go monkey to github.com/agiledragon/gomonkey/v2 v2.2.0. There is a test used to be working fine but is failing. { patch := gomonkey.NewPatches() defer patch.Reset() patch.ApplyFunc(xxfunc, func(_ context.Context, req model.XxReq) model.XxResult { return &model.XxResult{ ErrCode: 0, Message: &model.Message{ Message: model.PASS, }, } }) } I am getting error message like the following: target type(func(context.Context, model.XxReq, ...callopt.Option) model.XxResult) and double type(func(context.Context, model.XxReq) *model.XxResult) are different [recovered]