globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Add MarshalJSON function to raw.BSON #108

Closed SteelPhase closed 6 years ago

SteelPhase commented 6 years ago

This resolves globalsign/mgo#107 using the example provided in the issue.

domodwyer commented 6 years ago

Hi @SteelPhase

I'm up for this - I can see how it might help the users of bson.Raw building APIs etc and it's totally opt-in - other users don't pay a performance overhead for this added functionality - good idea!

We're pretty strict on tests for maintainability though, would you mind adding a couple for this? A happy-path test and a couple edge cases, preferably table driven?

Thanks for the PR! Dom

SteelPhase commented 6 years ago

Yeah. i'll look into adding tests.

domodwyer commented 6 years ago

Hi @SteelPhase

I'm going to close this because it's been a couple months - we'll still happily accept it if you have the time to add tests though.

Dom