Create a MongoDB Go Driver linter

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:

      1. Check for improper usage of bson.E as a nested document instead of bson.D.
      2. Check for improper passing of multiple options structs to some APIs (only Go Driver 2.x).
      3. Check for un-closed sessions and transactions.
      4. 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?

            Assignee:
            Unassigned
            Reporter:
            Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: