Open YouSec995 opened 1 year ago
i find a question :
type Outside struct { *Inner } type Inner struct { } func (gthis *Outside)MethodOut(){ //... gthis.MethodInner() } func (gthis *Inner)MethodInner(){ }
if you
var p *Outside p1 := gomonkey.ApplyMethod(reflect.TypeOf(p), "MethodInner", func() { fmt.Printf("applymethod succ") return }). // it will be invalid
but
var p *Inner p1 := gomonkey.ApplyMethod(reflect.TypeOf(p), "MethodInner", func() { fmt.Printf("applymethod succ") return }). // it will be valid
i find a question :
if you
but