[GODRIVER-884] Default for timestamps is a zero'd *time.Location, instead of `nil` Created: 18/Mar/19 Updated: 28/Oct/23 Resolved: 10/Apr/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 1.0.0 |
| Fix Version/s: | 1.0.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Loy | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | evg | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
We are currently in the process of migrating away from `mgo`, and to the official driver (thank you for making it!). In order to perform the migration smoothly, we are writing a suite of parity integration tests, verifying the exact behavior differences between the two libraries. (e.g. reflect.DeepEqual on two objects, one returned from `mgo` the other from official) One of our parity tests is failing, in regards to time zone translation when marshaling/un-marshaling a Golang `time.Time`. `mgo` sets the internal `*time.Location` as `nil`, while the official driver sets it to a zero value. I believe `nil` is actually more correct, as this mirrors what the standard library does. See `time.go#192`. When the time is set to `UTC`, it actually sets `loc` to `nil`. Because `time.Location` is set to the zero value, this is the representation of the time to default to system location, rather than UTC. |
| Comments |
| Comment by Githook User [ 10/Apr/19 ] |
|
Author: {'email': 'kris@mongodb.com', 'name': 'Kris Brandow', 'username': 'skriptble'}Message: Remove *Location in decoded time.Time values Change-Id: I1ef785f1ce1e9693e277d41c7a7b4672c411a551 |
| Comment by Githook User [ 10/Apr/19 ] |
|
Author: {'name': 'Kris Brandow', 'username': 'skriptble', 'email': 'kris@mongodb.com'}Message: Remove *Location in decoded time.Time values Change-Id: I1ef785f1ce1e9693e277d41c7a7b4672c411a551 |
| Comment by Kristofer Brandow (Inactive) [ 05/Apr/19 ] |
|
Code Review: https://review.gerrithub.io/c/mongodb/mongo-go-driver/+/450300. |