mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +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
|
// Value implements the driver.Valuer interface
|
||||||
// see http://jmoiron.net/blog/built-in-interfaces/
|
// see http://jmoiron.net/blog/built-in-interfaces/
|
||||||
func (t Time) Value() (driver.Value, error) {
|
func (t Time) Value() (driver.Value, error) {
|
||||||
|
if time.Time(t) == (time.Time{}) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
return time.Time(t), nil
|
return time.Time(t), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user