Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2696

Use an options pattern that doesn't require merging structs

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • 2.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Major Change

      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.

      Find and implement an optional arguments pattern that doesn't require maintaining dedicated code for merging each type of option struct together when multiple options structs are provided.

      Definition of done:

      • Implement an optional arguments pattern that doesn't require maintaining dedicated code for merging each type of option struct together.
      • Remove all Merge*Options options struct merging functions in all packages.

            Assignee:
            preston.vasquez@mongodb.com Preston Vasquez
            Reporter:
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: