[GODRIVER-605] bson codec is not supporting pointers for inline tags Created: 19/Oct/18 Updated: 27/Oct/23 Resolved: 19/Nov/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | BSON |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Mihai B | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Currently if the inline field is a pointer to a struct it returns an error. Pointers to structs are quite common if not idiomatic in Go. |
| Comments |
| Comment by Mihai B [ 10/Nov/18 ] |
|
Sorry for the delay. This is really something that I can't understand. Can you please let me know why you would not support pointers? What harm it makes ? You just need to check if it's a pointer and if so dereference it(like any other encoder from the Go community). Pointers are part of the language and one good reason why people should use pointers to structs is to reduce the memory usage. The language designers gave us pointers so that we can use them. Structs, being of the value data types are the main candidates for the use of pointers. Every single struct encoder supports pointers. |
| Comment by Kristofer Brandow (Inactive) [ 05/Nov/18 ] |
|
Closing due to inactivity. |
| Comment by Kristofer Brandow (Inactive) [ 22/Oct/18 ] |
|
Hi themihai, This follows the current behavior of the community Go driver's BSON library, which only support value structs and not pointers to structs. Can you elaborate on your use case for inlining a pointer to a struct? Thanks, Kris |