mercredi 13 janvier 2021

How to generate a dynamically named struct in Go

I need to read from a config file,for example,a series of variables,and create its respective struct named by their names,though the stuctures are all the same,obviouly I can't know the names of structs before runtime,so how can I dynamically create them,using reflection or some more gentle way?





Aucun commentaire:

Enregistrer un commentaire