diff --git a/x/jsonx/iso8601.go b/x/jsonx/iso8601.go index 464dba73..c5d22b8e 100644 --- a/x/jsonx/iso8601.go +++ b/x/jsonx/iso8601.go @@ -104,6 +104,8 @@ func (t *ISO8601) Scan(src interface{}) error { return err } *t = tt + case nil: + *t = ISO8601(time.Time{}) default: return fmt.Errorf("ISO8601: unknown type of: %T", v) } diff --git a/x/jsonx/kitchen_time.go b/x/jsonx/kitchen_time.go index 12197718..35f8a16c 100644 --- a/x/jsonx/kitchen_time.go +++ b/x/jsonx/kitchen_time.go @@ -100,6 +100,8 @@ func (t *KitckenTime) Scan(src interface{}) error { return err } *t = tt + case nil: + *t = KitckenTime(time.Time{}) default: return fmt.Errorf("KitckenTime: unknown type of: %T", v) } diff --git a/x/jsonx/simple_date.go b/x/jsonx/simple_date.go index df8d20e9..cb56cd9d 100644 --- a/x/jsonx/simple_date.go +++ b/x/jsonx/simple_date.go @@ -105,6 +105,8 @@ func (t *SimpleDate) Scan(src interface{}) error { return err } *t = tt + case nil: + *t = SimpleDate(time.Time{}) default: return fmt.Errorf("SimpleDate: unknown type of: %T", v) }