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.
- is related to
-
GODRIVER-413 Implement Improved BSON Design
- Closed