Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
-
None
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
Attachments
Issue Links
- duplicates
-
GODRIVER-305 reflection panics when doing equality comparisons
-
- Closed
-