[GODRIVER-2418] Standardize passing of pointers for interface{} in option setters Created: 10/May/22  Updated: 16/May/22

Status: Backlog
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Unknown
Reporter: Benji Rewis (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: techdebt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We have a number of setters in the driver that take an interface{} as a parameter and use it to set a field on the receiver that is also of type interface{}. Some of those setters do receiver.field = &value while others do receiver.field = value. If I'm not mistaken, because of automatic dereferencing, either seems to work (although I also thought Go does not automatically dereference pointers to interfaces). However, we should standardize how these setters set their field and determine if passing by pointer is ever needed (it might be because of other code that needs to modify the initial value).

The driver uses pointer fields to allow "nil means unset" semantics in a lot of places, so I was assuming someone unintentionally followed the same pattern without realizing they were assigning to an interface{} field.


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