vendredi 30 octobre 2015

How to switch on reflect.Type?

I have managed to do this, but it does not look efficient:

var t reflect.Type
switch t {
case reflect.TypeOf(([]uint8)(nil)):
    // handle []uint8 array type
}





Aucun commentaire:

Enregistrer un commentaire