[GODRIVER-344] isZero function should compare structs with DeepEquals Created: 05/Apr/18 Updated: 11/Apr/18 Resolved: 11/Apr/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Thomas Delacour (Inactive) | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Structs in Go can't be directly compared with simple equality if they contain slice, map, or function fields. Currently, if such a struct is passed through the BSON encoder and the isZero function is hit, a panic is triggered. Should instead use reflect.DeepEqual at this line: https://github.com/mongodb/mongo-go-driver/blob/master/bson/encode.go#L466 |