The readpref.WithTags function is broken

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 0.0.13
    • Affects Version/s: 0.0.12
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
              Reporter:
              Kristofer Brandow (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: