globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Gratuitous time zone remapping breaks user code #345

Closed derrickburns closed 5 years ago

derrickburns commented 5 years ago

https://github.com/globalsign/mgo/pull/42

breaks all user code that compares original versus retrieved versions of a Mongo object with an embedded time field Time objects if the original version is not in UTC.

This includes practically all Gomega Unit tests that use DeepEqual on structs with Time objects.

This was a bad idea.

domodwyer commented 5 years ago

Hi @derrickburns

Thanks for the ticket - perhaps you're looking for https://golang.org/pkg/time/#Time.Equal

Best wishes.