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

Golang decode doesn't work with interfaces

    • Type: Icon: Improvement Improvement
    • Resolution: Gone away
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      When unmarshaling objects in Go, you can't pass in an interface, however it works when unmarshaling json.

       

      ```

      type X interface {}

      type Y struct {}

       

      var z X

      z = &Y{}

       

      d.Decode(z) // works in json, not with bson.

      ```

       

      This is severely limiting for what we can do with the API

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            teeling.sean@gmail.com Sean Teeling
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: