[GODRIVER-2530] Customer marshal method with pointer receiver not called for map values unless values are pointers Created: 21/Aug/22 Updated: 27/Oct/23 Resolved: 23/Aug/22 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Marc Adkins | Assignee: | Preston Vasquez |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
| Comments |
| Comment by Marc Adkins [ 22/Aug/22 ] |
|
I filed this same bug against encoding/json and the answer is that "map values are unaddressable" whereas array values are addressable. This is apparently expected behavior. Confirmed (I guess) with https://go.dev/play/p/RLjONtkgHP8 You should close this bug. |
| Comment by Marc Adkins [ 22/Aug/22 ] |
|
I have similar code using JSON and YAML. I went back to try and use objects instead of pointers there and neither works. YAML doesn't work at all and JSON seems to have the same behavior as this bug. I'll be digging in there for a bit and will update this bug if I find anything useful.
|
| Comment by Marc Adkins [ 21/Aug/22 ] |
|
Something happened to my output text in the body of the issue. I've attached it as an additonal text file output.txt. |