Update bson encoding library to mongo-driver/v2#174
Merged
paulmach merged 1 commit intopaulmach:masterfrom Mar 29, 2026
Merged
Conversation
Owner
|
the v2 version requires generics, I upgrade the goversion of this module from 1.15 -> 1.25 in this pr #175 Please rebase your changes |
Contributor
Author
|
Just rebased, thanks for updating the go version of the module. |
rainervonuns
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This library depends on the deprecated
v1ofgo.mongodb.org/mongo-driverfor it'sbsonencoding: https://pkg.go.dev/go.mongodb.org/mongo-driver/bsonSome
go getandgo modcommands therefore produce a deprecation warning, prompting users to upgrade. To get rid of this warning, this PR implements the upgrade tov2of the bson library: https://pkg.go.dev/go.mongodb.org/mongo-driver/v2/bsonThere are only two small differences that needed to be accounted for:
go.mongodb.org/mongo-driver/bson/bsontypepackage no longer exists, instead the types are now available directly in thev2/bsonpackage, i.e.bsontype.Nullbecomesbson.TypeNullValueMarshalerinterface was changed to the signatureMarshalBSONValue() (byte, []byte, error): https://github.com/mongodb/mongo-go-driver/blob/8fe7e71d20cb313b3cc9ea9a0987ea17b6358c23/bson/marshal.go#L41, so this PR also updates it accordingly.