Closed larrycinnabar closed 6 years ago
BSON encoder doesn't allow to use pointers to struct in inline mode.
inline
There was an issue on the same topic on old repo: https://github.com/go-mgo/mgo/issues/346
Such structure:
type MStruct struct { M int `bson:"m,omitempty"` } type inlinePtrStruct struct { A int *MStruct `bson:",inline"` }
is assumed to become {"a":0, "m":0} (without mstruct structure) - the same way as json encoder does it
{"a":0, "m":0}
mstruct
json
without fix we get: "reflect: indirection through nil pointer to embedded struct"
close as open new one with the development branch
BSON encoder doesn't allow to use pointers to struct in
inline
mode.There was an issue on the same topic on old repo: https://github.com/go-mgo/mgo/issues/346
Such structure:
is assumed to become
{"a":0, "m":0}
(withoutmstruct
structure) - the same way asjson
encoder does itwithout fix we get: "reflect: indirection through nil pointer to embedded struct"