mardi 29 novembre 2016

Golang reflect: Get Type representation from name?

Is there a way to use the reflection libraries in Go to go from the name of a type to its Type representation?

I've got a library where the user needs to provide Type representations for some code generation. I know it must be possible (in a sense) because they can just create a variable of that type and call the TypeOf function, but is there a way to circumvent this and just get representation from the name?





Aucun commentaire:

Enregistrer un commentaire