mardi 25 août 2015

Convert reflect.value to reflect.method

I have the fallowing:

func NewMethodDescriptor(typ interface{}) *MethodDescriptor {

    reflectedMethod := reflect.ValueOf(typ)
    methodType := reflectedMethod.Type
    paramCount := methodType.NumIn() - 1
    ...

But when I try:

NewMethodDescriptor(func(){})

I get this compile time error:

methodType.NumIn undefined (type func() reflect.Type has no field or method NumIn)





Aucun commentaire:

Enregistrer un commentaire