type Teacher struct {
Name string `json:"name"`
Age int `json:"age"`
}
func getTag(i interface{}) string
getTag(teacher.Name) // print name
getTag(teacher.Age) // print age
I wanna roll my function like the code segment, but I can't find a way to achieve this. Any Ideas?
Aucun commentaire:
Enregistrer un commentaire