Closed aksentyev closed 6 years ago
Hi @aksentyev
This is fantastic - I've personally been burnt by this loads of times writing integration tests! Thanks for another great PR.
Dom
@domodwyer Unfortunately, this change breaks SASL Authentification, I need some time to investigate and improve changes.
@aksentyev thanks for the PR, just one question. Why did the sasl code have to be updated?
returning nil instead of []byte{} on an error path seems to be the correct thing.
@tadukurow I agree, fixed)
Hi @aksentyev
Would you pull the latest dev in and we'll merge?
Sorry for the delay - we've been super busy - thanks for opening this PR!
Dom
Hi! BSON package initializes nil slices and maps by default. It makes using reflect.DeepEqual or test assertions non trivial task. This PR allowes to enable or disable the feature of using
null
's for not initialized slices and maps (e.g. withmake()
). This change does not change the default behaviour ofbson.Marshal
/bson.Unmarshal
so it has backward compatibility with previous versions of the package.