diff --git a/creflect/type.go b/creflect/type.go index 071acd7..4137cd8 100644 --- a/creflect/type.go +++ b/creflect/type.go @@ -38,7 +38,7 @@ type funcValue struct { func funcPointer(v reflect.Method, ok bool) (unsafe.Pointer, bool) { return (*funcValue)(unsafe.Pointer(&v.Func)).p, ok } -func AllMethodByName(r reflect.Type, name string) (fn unsafe.Pointer, ok bool) { +func MethodByName(r reflect.Type, name string) (fn unsafe.Pointer, ok bool) { t := Create(r) if r.Kind() == reflect.Interface { return funcPointer(r.MethodByName(name)) diff --git a/patch.go b/patch.go index e1dc3bb..60c1094 100644 --- a/patch.go +++ b/patch.go @@ -76,7 +76,7 @@ func (this *Patches) ApplyMethod(target reflect.Type, methodName string, double } func (this *Patches) ApplyPrivateMethod(target reflect.Type, methodName string, double interface{}) *Patches { - m, ok := creflect.AllMethodByName(target, methodName) + m, ok := creflect.MethodByName(target, methodName) if !ok { panic("retrieve method by name failed") }