Recently I saw that mgo was no longer going to be maintained and I have a recent project with mgo. My question is if there is a problem with that? There are no risks?
3 Answers
Basically you may continue to use it, but since it's not maintained anymore, that means bugs discovered in it will not be fixed, and new features of MongoDB servers will not get added to it.
If you read the README of the github project (https://github.com/go-mgo/mgo), it lists your options.
The first suggests to use the community supported fork: github.com/globalsign/mgo
. This is maintained, support for new features are being added, and it has the same API as the original package.
Since globalsign/mgo
has identical API, there is no reason not to switch to it. It will most likely only take to change your imports.
Also note that there is an official MongoDB Go driver under development, it was announced here: Considering the Community Effects of Introducing an Official MongoDB Go Driver. It's project and source code is available here: github.com/mongodb/mongo-go-driver
. It's currently in alpha phase, so it's nowhere near production ready (and they don't even have an estimated date when it will be ready). If you need a driver now, globalsign/mgo
is the best option at the moment.
Do note that both the official driver and globalsign/mgo
are getting support for newest features and additions of the MongoDB server, as an example, both support change streams (it wasn't in the original mgo
driver). For details, see: Watch for MongoDB Change Streams

- 389,944
- 63
- 907
- 827
There will be problems if:
- You want to get some new features in mongodb and current mgo library doesn't support
- There is a bugs/security issue in mgo library.
That's one of the reason why i'm not using mgo.

- 6,083
- 12
- 25
-
What are you currently using? – andersonqi Nov 12 '18 at 02:43
-
I switched to swift rather than go. :( I intended to use golang and then i discovered that the libraries are not matured/maintained well enough to use – Daniel Tran Nov 12 '18 at 02:45
-
It's official driver from mongodb team but it's in alpha stage for now. – Daniel Tran Nov 12 '18 at 02:48
-
Thanks a lot but what I now have with mgo works well! I can leave it working? – andersonqi Nov 12 '18 at 03:28
-
Sure. Only consider what I mentioned in the answer. If it doesn’t affect. Stay with mgo – Daniel Tran Nov 12 '18 at 03:34
There will be an Official MongoDB Go Driver.
Considering the Community Effects of Introducing an Official MongoDB Go Driver

- 158,998
- 31
- 281
- 276