Fixed datetime unmarshalling issue
This commit is contained in:
parent
914f740c3e
commit
45f5769c98
1 changed files with 1 additions and 3 deletions
4
types.go
4
types.go
|
@ -154,10 +154,8 @@ func (t *NullTime) UnmarshalJSON(b []byte) error {
|
||||||
var err error
|
var err error
|
||||||
json.Unmarshal(b, &x)
|
json.Unmarshal(b, &x)
|
||||||
switch x.(type) {
|
switch x.(type) {
|
||||||
case time.Time:
|
case string:
|
||||||
err = json.Unmarshal(b, &t.Time)
|
err = json.Unmarshal(b, &t.Time)
|
||||||
case map[string]interface{}:
|
|
||||||
err = json.Unmarshal(b, &t.NullTime)
|
|
||||||
}
|
}
|
||||||
t.Valid = true
|
t.Valid = true
|
||||||
return err
|
return err
|
||||||
|
|
Reference in a new issue