Closed smallchimney closed 8 months ago
Is there any possible to upgrade GetPrivateMethod
to generic function in place?
I've tryed to resolve function type from reflect information, but saddly the type info of private methods have not been written for reflect package
btw, the branch develop
described in CONTRIBUTION.md is not exist yet.
add the missing license decriptions
Good job. But some tests failed ...
Try put generics-required code into another .go
file with compile option like this:
//go:build go1.18
// +build go1.18
The CI testing is failed with Go1.13, which reflect.Pointer
has not been declared, I changed to use reflect.Ptr
for the compatibility
some tests still failed
fixed, I've tried go1.13, 1.16, 1.17, 1.18, 1.19 and 1.20 on my dev env.
What type of PR is this?
feat: A new feature
What this PR does / why we need it (en: English/zh: Chinese):
en: 1. We need to mock some method even if it's not exported, like
(*sha256.digest).checksum
or other method; 2. We need some helper function to migrategomonkey.ApplyPrivateMethod
. zh: 1. 某些场景下我们需要Mock私有方法,比如(*sha256.digest).checksum
;2. 我们需要一个辅助函数去实现从gomonkey.ApplyPrivateMethod
的代码实现迁移。