dat icon indicating copy to clipboard operation
dat copied to clipboard

Fix panic on NullTime.UnmarshalJSON

Open khoden opened this issue 8 years ago • 2 comments

type WithDate struct {
	Time dat.NullTime `json:"time"`
}

func TestParseNumberAsDate(t *testing.T) {
	data := `{"time":5}`
	result := &WithDate{}
	json.Unmarshal([]byte(data), result) // PANIC!
}

khoden avatar Aug 03 '17 08:08 khoden

This test should probably be added to the actual tests as well.

JelteF avatar Aug 15 '17 09:08 JelteF

Please, accept

khoden avatar Aug 25 '17 06:08 khoden