mercredi 2 août 2017

Find underlying anonymous field type for struct in Go

I have these two structs:

type CustomTime struct {
    time.Time
}

type Events struct {
    Timestamp CustomTime
}

When I reflect the field for Events.Timestamp, I get CustomTime; how can I get the actual underlying type which is time.Time?





Aucun commentaire:

Enregistrer un commentaire