I know how to check if an interface is a pointer:
func isPointerArray(i interface{}) bool {
if i == nil {
return false
}
if reflect.ValueOf(i).Kind() != reflect.Ptr {
return false
}
}
But how can I check if that pointer is a slice? TypeOf
is a pointer.
Aucun commentaire:
Enregistrer un commentaire