I was creating unary tests when I got stuck on the following situation:
However, I can't find the way to set my bson.ObjectId
as nil
or zero.
Does anyone knows how to do or a work around?
Or you can use the primitive.NilObjectID
NilObjectID is the zero value for ObjectID.
bson.ObjectId is an alias for string , therefore the zero value is an empty string ""
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With