Fixed datetime unmarshalling issue

This commit is contained in:
Matthew Dillon 2015-08-31 12:01:17 -07:00
parent 914f740c3e
commit 45f5769c98

View file

@ -154,10 +154,8 @@ func (t *NullTime) UnmarshalJSON(b []byte) error {
var err error
json.Unmarshal(b, &x)
switch x.(type) {
case time.Time:
case string:
err = json.Unmarshal(b, &t.Time)
case map[string]interface{}:
err = json.Unmarshal(b, &t.NullTime)
}
t.Valid = true
return err