"bson.MarshalValue" does not support "any" value of "nil"

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The MarshalValue function returns an error if you try to marshal a value like var v any = nil, despite the same value marshaling correctly to BSON "null" when using Marshal.

      Check out an example using MarshalValue here. Check out an example using Marshal here.

      Definition of done:

      • Calling bson.MarshalValue(nil) returns type "bsontype.Null", an encoded BSON "null" value, and no error.

              Assignee:
              Unassigned
              Reporter:
              Matt Dale
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: