MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Mongo-go-driver and mongo-driver

Hello, may be a silly question, but I found in GitHub there is a version of mongo-go-driver,


and I import the one go.mongodb.org/mongo-driver/

what’s the difference of the two drivers? thanks.

Hi,

These are the same thing. go.mongodb.org/mongo-driver is a redirect to github.com/mongodb/mongo-go-driver. There’s some information about custom import paths at https://golang.org/cmd/go/#hdr-Remote_import_paths.

– Divjot

Hello Divjot,

We use gitlab build our revision control system which is used only in our company, in this case I should use go.mongodb.org or github.com/mongodb, or both will work fine.

thanks,

James

You should use go.mongodb.org for all import paths. Your choice of version control system shouldn’t matter for this. Basically, Go will try to fetch the dependencies from go.mongodb.org/mongo-driver, which will reroute to github.com/mongodb/mongo-go-driver and it can download the dependencies from there as it needs.

Wow, An answer in 5 minute! Thank you so much!