agiledragon / gomonkey

gomonkey is a library to make monkey patching in unit tests easy
MIT License
1.92k stars 178 forks source link

Why no ApplyPrivateMethodFunc? #167

Closed dablelv closed 6 days ago

dablelv commented 1 month ago

There is ApplyMethodFunc, why no ApplyPrivateMethodFunc?

Because ApplyMethod and ApplyMethodFunc are a pair, so I think ApplyPrivateMethod and ApplyPrivateMethodFunc should be a pair.

agiledragon commented 3 weeks ago

No, they have different underlying implementations. For ex, the implementation of ApplyPrivateMethod relies on customized reflection.