-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GODRIVER-2866 Update method signatures of bson.ValueMarshaler
/bson.ValueUnmarshaler
to only use basic types.
#1671
Conversation
….ValueUnmarshaler` to only use basic types.
API Change Report./bsonincompatible changes(*D).UnmarshalJSON: removed |
bson/marshal.go
Outdated
@@ -34,7 +34,7 @@ type Marshaler interface { | |||
// create custom BSON marshaling behavior for an entire BSON document, implement | |||
// the Marshaler interface instead. | |||
type ValueMarshaler interface { | |||
MarshalBSONValue() (Type, []byte, error) | |||
MarshalBSONValue() (byte, []byte, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: Consider adding named returns to the interface to describe what the values are, since we're removing some type information. We may also want to update the documentation.
MarshalBSONValue() (byte, []byte, error) | |
MarshalBSONValue() (typ byte, data []byte, err error) |
bson/unmarshal.go
Outdated
@@ -31,7 +31,7 @@ type Unmarshaler interface { | |||
// document. To create custom BSON unmarshaling behavior for an entire BSON | |||
// document, implement the Unmarshaler interface instead. | |||
type ValueUnmarshaler interface { | |||
UnmarshalBSONValue(Type, []byte) error | |||
UnmarshalBSONValue(byte, []byte) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: Consider adding named parameters to the interface to describe what the values are, since we're removing some type information. We may also want to update the documentation.
UnmarshalBSONValue(byte, []byte) error | |
UnmarshalBSONValue(typ byte, data []byte) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍
GODRIVER-2866
Summary
Update method signatures of
bson.ValueMarshaler
/bson.ValueUnmarshaler
to only use basic types.