Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-759

Make Cursor a struct and make changeStream public

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 0.3.0
    • None
    • None
    • None

    Description

      In Go, it is idiomatic for the consumers of an interface to declare the type, not the implementer. There is an exception for interfaces that have multiple implementations in the same package, but generally, this rule should be followed. For this reason, the Cursor type should be redefined as a struct instead of an interface. Additionally, since the cursor returned from Watch will require a new method that will not be on Cursor the changeStream type should be made public and be returned from Watch.

       

      https://github.com/golang/go/wiki/CodeReviewComments#interfaces

      Attachments

        Activity

          People

            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: