mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
fix: if it's an empty time, do not return a driver value
This commit is contained in:
parent
917684aa27
commit
f3577a4182
|
@ -176,6 +176,9 @@ func NewTimeFromUnix(sec int64, nsec int64) Time {
|
|||
// Value implements the driver.Valuer interface
|
||||
// see http://jmoiron.net/blog/built-in-interfaces/
|
||||
func (t Time) Value() (driver.Value, error) {
|
||||
if time.Time(t) == (time.Time{}) {
|
||||
return nil, nil
|
||||
}
|
||||
return time.Time(t), nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user