[GODRIVER-1350] Zeroer improvement causes primitive.Binary with no data to be zeroed to nil Created: 18/Oct/19 Updated: 27/Oct/23 Resolved: 25/Oct/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Eric Daniels (Inactive) | Assignee: | Divjot Arora (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
It used to be the case that unmarshaling absent data for a field onto a primitive.Binary would set Data to []uint8{} but now it is being set to []uint8(nil). |
| Comments |
| Comment by Divjot Arora (Inactive) [ 22/Oct/19 ] |
|
Ah, I was missing the omitempty part. I think I understand this now. Before |
| Comment by Eric Daniels (Inactive) [ 19/Oct/19 ] |
|
So you need to be on master of driver and also do an omitempty tag on the binary field. |
| Comment by Divjot Arora (Inactive) [ 18/Oct/19 ] |
|
eric.daniels I couldn't reproduce this. Can you look it over my attempted repro at https://play.golang.org/p/4-bVA89rx-U and let me know if my understanding of the ticket is wrong? |