dimanche 19 mars 2023

How to get chain of types of a variable using reflection?

I have types like this:

type A struct{}
type B A
type C B

than I have a variable:

var my C

How do I get all the reflect.Type for (my, C, B, A, ...) during runtime.

Of course the "chan" of types during runtime might be defferent. Im looking for general solution to this problem.





Aucun commentaire:

Enregistrer un commentaire