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

The readpref.WithTags function is broken

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.0.13
    • Affects Version/s: 0.0.12
    • None

      The readpref.WithTags function was entirely broken for any length of arguments n*2 where n > 1 or exactly 0 arguments.

      0 arguments:
      It only checked for length % 2 == 0 which a length of 0 obviously passes but that obviously isn't a legal tag.

      Multiple of 2 arguments:
      That for-loop was just completely wrong only accidentally being correct for exactly 2 tags.
      It essentially made every key into a name and what should have been the next name into a key,
      because it didn't skip any index but instead terminated at just half length, which also meant it would not include any actual later tags pairs.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: