type NullTime

NullTime 表示可能为空的时间。NullTime 实现了 Scanner 接口,因此可以将其用作扫描目标,类似于 NullString。

结构如下:

type NullTime struct {
Time  time.Time
Valid bool // Valid is true if Time is not NULL
            }