How can I do this? I want a function to be able to return me the same type as it got it from one of its argument. I need something like the below:
type Whatever struct {
Title string
}
hey:= Whatever{Title:"YAY"}
thetype := reflect.ValueOf(hey).Kind()
// This does not work
BB:= new(thetype)
Aucun commentaire:
Enregistrer un commentaire