Details
-
Improvement
-
Resolution: Unresolved
-
Unknown
-
None
-
None
-
None
-
Major Change
Description
Currently we maintain many Merge*Options functions that merge options structs together. These are used to merge possibly many options structs passed to functions that accept a variadic argument of 0 or more options structs. While that function signature has the benefit of allowing users to pass or not pass options, maintaining the Merge*Options functions adds a significant maintenance burden and has resulted in numerous bugs. Very few users pass multiple options structs (maybe no users), so there's no major need to support passing more than 1 options struct. Instead, return an error if 2 or more options structs are passed and remove all Merge*Options functions.
Definition of done:
- For all functions that accept a variadic argument for function options structs, accept either 0 or 1 structs. If the user passes 2 or more structs, return an InvalidArgumentError.
- Remove all Merge*Options options struct merging functions in all packages.
Attachments
Issue Links
- depends on
-
GODRIVER-2689 Simplify the "readpref" API
-
- Backlog
-
-
GODRIVER-2685 Simplify "writeconcern" API
-
- Closed
-
-
GODRIVER-2686 Simplify "readconcern" API
-
- Closed
-
-
GODRIVER-2749 Deprecate all "Merge*Options" functions
-
- Closed
-
- has to be done after
-
GODRIVER-2617 Remove or un-export all currently deprecated code in Go Driver 2.0
-
- Closed
-
- is depended on by
-
GODRIVER-2499 Use a nested struct for default transaction options
-
- Blocked
-
-
GODRIVER-2699 Accept exactly one "ClientOptions" in "mongo.Connect"
-
- Blocked
-
- is related to
-
GODRIVER-2804 Merging ChangeStreamOptions can squash the FullDocument configuration
-
- Closed
-