dat
dat copied to clipboard
Fix panic on NullTime.UnmarshalJSON
type WithDate struct {
Time dat.NullTime `json:"time"`
}
func TestParseNumberAsDate(t *testing.T) {
data := `{"time":5}`
result := &WithDate{}
json.Unmarshal([]byte(data), result) // PANIC!
}
This test should probably be added to the actual tests as well.
Please, accept