lundi 28 juin 2021

Find a type to its module and name in Golang

in Golang, I am wondering if there it is a way to find a type by its module and name? For example,

// we got a package "playground/types_demo"
package types_demo

type DemoStruct struct {} // <-- it can be found like "playground/type_demo.DemoStruct"
func DemoFunction() {}.   // <-- similarly "playground/type_demo.DemoFunction"

I am working on a project. it will be cool if it can be implemented in a "low code" way. Then, the framework user can define what struct or function will be used.





Aucun commentaire:

Enregistrer un commentaire