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

Support `json:"-"` tags in the bson encoder

    • Type: Icon: New Feature New Feature
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 0.0.3
    • Component/s: BSON
    • None

      Protobuf has merged https://github.com/golang/protobuf/tree/dev into master on the 30th of april which will cause problems to anyone using protobuf generated code to encode data to bson.

      https://groups.google.com/forum/#!topic/protobuf/N-elvFu4dFM

      Specifically, they added 3 new fields to all generated structs

      ```

      XXX_NoUnkeyedLiteral struct{}        `json:"-""`

      XXX_unrecognized     []byte          `json:"-""`

      XXX_sizecache        int32           `json:"-"`

      ```

      The fix is to manually add a `bson:"-"` tag, however this breaks any CI that auto-regenerates protobuf on compilation.

      If the `bson` encoder supported reading the json tags it would work seamlessly.

       

       

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

              Created:
              Updated:
              Resolved: