Details
-
New Feature
-
Resolution: Unresolved
-
Unknown
-
None
-
None
-
None
-
None
Description
Create a linter that reports when the MongoDB Go Driver is used in erroneous or error-prone ways. Specifically, cover cases that are detectable by static analysis, but don't cause compilation failures.
Proposed MongoDB Go Driver linter checks:
- Check for improper usage of bson.E as a nested document instead of bson.D.
- Check for improper passing of multiple options structs to some APIs (only Go Driver 2.x).
- Check for un-closed sessions and transactions.
- Check for operations inside WithSession or WithTransaction not using the SessionContext.
Definition of done:
- Create a Go linter that checks for some or all of the proposed problems above.
Open questions:
- What is the full list of checks?
- Should we create a new repository or release the linter as a submodule from the Go driver repository?