dimanche 15 juillet 2018

how to get caller arguments string in golang? is it impossible?

So how to return user.Class.Name string in reflectCallArgs, is it impossible?

type User struct {
    Class struct {
        Name string
    }
}
var user = &User{}
reflectCallArgs := func(src interface{}) string {
    //how to get this string?
    return "user.Class.Name"
}
reflectCallArgs(user.Class.Name)





Aucun commentaire:

Enregistrer un commentaire