Simple: the student is saved in the database, then reloaded. I expect the two objects to be the same. Here is what I get:
go run test.go
original
{1 2018-12-19 10:27:11.293548697 +0100 CET m=+0.000199613}
saved
{1 2018-12-19 10:27:11.293548697 +0100 CET m=+0.000199613}
fetched
{1 2018-12-19 10:27:11.293548697 +0100 CET}
Why is time.Time loosing precision in the process ? I have the same problem with gob.Codec.
This is not related to Storm, this is related to the way JSON and Gob encode and decode time.
If you need more information you can take a look at this issue: https://github.com/golang/go/issues/17875
Consider this:
Simple: the student is saved in the database, then reloaded. I expect the two objects to be the same. Here is what I get:
Why is
time.Time
loosing precision in the process ? I have the same problem withgob.Codec
.