[GODRIVER-359] Add bson.Zeroer types for comparing structs Created: 11/Apr/18 Updated: 28/Oct/23 Resolved: 02/May/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | 0.0.2 |
| Fix Version/s: | 0.0.4 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kristofer Brandow (Inactive) | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | FreeMonitoring, evg | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Currently we attempt to determine if a struct is the zero type in the BSON library by using == which does not work for many types of structs. Instead, create a bson.Zeroer interface with a single method IsZero() bool and use that when determining if a struct is zero. If the struct does not implement this type, then the struct is not zero. |