【发布时间】:2017-08-02 16:15:57
【问题描述】:
我有这两个结构:
type CustomTime struct {
time.Time
}
type Events struct {
Timestamp CustomTime
}
当我reflectEvents.Timestamp 的字段时,我得到CustomTime;如何获得 time.Time 的实际底层类型?
【问题讨论】:
-
Timestamp的类型是CustomTime。嵌入不是继承。 -
你想完成什么?
-
可能是XY问题?
-
这个问题听起来很像,是的。
标签: go reflection struct anonymous