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

Marshaller interface usage

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      If I use the `Marshaller` interface on a type to output a slice, it fails with the following error :

      `WriteArray can only write a Array while positioned on a Element or Value but is positioned on a TopLevel`

      You can see this inĀ https://play.golang.org/p/Sc5Fk_ACvpB

      From what I investigated I understood that the call to `bson.Marshal` I do inside `MarshalBSON` thinks the slice is at top level and so refuse to marshal it. Is there an other way to marshal bson w/o that constraint ?

            Assignee:
            divjot.arora@mongodb.com Divjot Arora (Inactive)
            Reporter:
            thomas.bruyelle@keeneye.tech Thomas Bruyelle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: