I found an answer.
bson/primitive
package. This package is now merged with the bson
package. To update your code, remove any bson/primitive
import statements and change any instance of primitive.ObjectID
to bson.ObjectId
.Ref: https://www.mongodb.com/docs/drivers/go/upcoming/whats-new/#what-s-new-in-2.0