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

Make Cursor a struct and make changeStream public

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.3.0
    • Affects Version/s: None
    • Component/s: None
    • None

      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

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

              Created:
              Updated:
              Resolved: