globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Fix GoLint Warnings #297

Closed mihai-tiriplica-hs closed 5 years ago

mihai-tiriplica-hs commented 5 years ago

Hello, I noticed that mgo is not really golint compliant (started from methods like FindId which golint expects to be FindID). This becomes a problem when someone wants to start from the mgo interface and implement the logic because golint will start failing on the project.

To be speicific, my usecase for implementing the Collection interface is to add performance monitoring for mongo calls. I know this can be fixed on my end but it would be nice to fix this in mgo too.

I also know this is a breaking change but if you think it's valuable I can start implementing the new methods and deprecate the old ones in a future version.

domodwyer commented 5 years ago

Hi @mihai-tiriplica-hs

We're aware of the unfortunate FindId and friends - we have linting for new PRs but unfortunately we have had to whitelist the existing lint failures inherited when we forked the code.

Changing these method names would be a very breaking change, so we've had to live with it as is I'm afraid! Sorry it's having knock on effects for your code - perhaps wrapping mgo in a struct would help?

Dom