gomonkey icon indicating copy to clipboard operation
gomonkey copied to clipboard

Quesion of calling original function

Open cutecutecat opened this issue 3 years ago • 1 comments

After I have mocked a function A by function B, is there any way to call original A function inside B? Which might be helpful for user to check or log arguments and return values. Thanks!

如果我用B函数替换了对A函数的调用,那么有没有办法在B函数体内部,完成正常的A函数调用流程,这样会对函数参数以及返回值的检查或者统计会有很大帮助。 非常感谢!

cutecutecat avatar Aug 01 '21 13:08 cutecutecat

I miss same functionality: trying to test Mutex.Lock() and Mutex.Unlock() method calls but need to execute original code from patched function to not break things like testify/assert, etc (those who uses mutexes internally)

Found no solution for the moment

mxpaul avatar Nov 23 '21 08:11 mxpaul