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

Reverse Dependencies of bson and bsoncodec

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.0.17
    • Affects Version/s: 0.0.15
    • Component/s: BSON
    • None

      TheĀ  bsoncodec package currently depends on the bson package. This means that the types within the bson package cannot marshal themselves. This causes problems for constructing *bson.Element's from an empty interface, but it also means that a ToExtJSON method cannot be part of a *bson.Document.

      Additionally, with functions like Marshal and Unmarshal being part of the bsoncodec package, users are required to import both packages for most of their BSON usage. This includes the Encoder and Decoder types.

      To fix these problems and prepare for further improvements to the BSON library, reverse the dependency between bson and bsoncodec to have the bson package depend on the bsoncodec package.

      Split the ValueReader and ValueWriter types into their own package called bsonrw and create a public test implementation in a package called bsonrwtest.

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

              Created:
              Updated:
              Resolved: