You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fix GetBSON() method usage
Original issue
---
You can't use type with custom GetBSON() method mixed with structure field type and structure field reference type.
For example, you can't create custom GetBSON() for Bar type:
```
struct Foo {
a Bar
b *Bar
}
```
Type implementation (`func (t Bar) GetBSON()` ) would crash on `Foo.b = nil` value encoding.
Reference implementation (`func (t *Bar) GetBSON()` ) would not call on `Foo.a` value encoding.
After this change
---
For type implementation `func (t Bar) GetBSON()` would not call on `Foo.b = nil` value encoding.
In this case `nil` value would be seariazied as `nil` BSON value.
For reference implementation `func (t *Bar) GetBSON()` would call even on `Foo.a` value encoding.
* Minor refactoring
0 commit comments