Closed zhongyuanjia closed 2 years ago
private method? Other features are independent of go version.
yep, I currently use the following method instead of the ApplyPrivateMethod
type Patch struct {}
func (*Patch) method() int { return 1 }
func (Patch) method2() int { return 1 }
patches = gomonkey.NewPatches()
defer patches.Reset()
patches.ApplyFunc((*Patch).method, func() { return 2 })
patches.ApplyFunc(Patch.method2, func() { return 3 })
It works fine on go1.18, but it can only be used inside packages
I think it will be supported next month!
I look forward to it. thanks a lot
fully support private method in the v2.7.0 @metauro
nice, thanks a lot again
hello, has any plan for 1.18 support?