mercredi 28 septembre 2016

Golang Reflect Return Values

I am having a few issues with return values on a call, I have the below

err := reflect.ValueOf(a.a).MethodByName(gatherList[x]).Call([]reflect.Value{})

The issue is with the return value which is nil

I cant do the usual error check as I get the following.

cannot convert nil to type reflect.Value

when I try to print the contents of err i get;

[<error Value>]

not really sure how to move forward with this error check, any help would be great.





Aucun commentaire:

Enregistrer un commentaire