[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:
Duplicate
duplicates GODRIVER-305 reflection panics when doing equality... Closed

 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


Generated at Thu Feb 08 08:34:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.