reflection - Convert reflect.value to reflect.method -


i have fallowing:

func newmethoddescriptor(typ interface{}) *methoddescriptor {      reflectedmethod := reflect.valueof(typ)     methodtype := reflectedmethod.type     paramcount := methodtype.numin() - 1     ... 

but when try:

newmethoddescriptor(func(){}) 

i compile time error:

methodtype.numin undefined (type func() reflect.type has no field or method numin) 


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -