Closed amnonbc closed 1 year ago
RawToString is a flag for every handle (including json, cbor, msgpack, etc). This is why it's under BasicHandle. We cannot add commentary that is specific to any one handle in there.
The msgpack specific flags will be under MsgpackHandle (eg WriteExt, NoFixedNum, etc)
closing - see message above
https://github.com/ugorji/go/blob/3cfaa077b94e38bae0008f229b2d7a565cc29e96/codec/decode.go#L316-L319 states
But in the old msgpack spec the raw types have op-codes 0xda for raw 16, oxdb for raw 32, and anything starting with the binary prefix 101 for fix raw. These opcodes are equal to the corresponding string types in the new spec.
What the RawToString flag does is it forces Binary types bin8, bin16, bin32 to be decoded as the corresponding string type. It would be less confusing if
RawToString
was renamedBinToString
. Changing the name at this point is probably not worth the pain. But It would be useful if the comment was updated.