CBOR defines a self-describing tag which can be added to any item in a CBOR stream. It has no semantic meaning on the content:
It does not impart any
special semantics on the data item that follows; that is, the
semantics of a data item tagged with tag 55799 is exactly identical
to the semantics of the data item itself.
I therefore want to be able to decode some CBOR, but silently strip all 55799 tags as I encounter them.
CborHandle.SetInterfaceExt() seems like the right place, except that a) I don't want to add 55799 tags when I encode, and b) I want to be able to strip a 55799 tag in any location, on any item encoding any type. But adding a handler for interface{} seems like it breaks too many assumptions.
Is it possible to a) achieve this using existing codec features? or b) allow codec to (optionally) silently strip all 55799 tags when decoding?
(For context, my use case is implementing a Dhall library; it has defined CBOR semantics here, including the possibility of tag 55799 appearing anywhere.)
CBOR defines a self-describing tag which can be added to any item in a CBOR stream. It has no semantic meaning on the content:
I therefore want to be able to decode some CBOR, but silently strip all 55799 tags as I encounter them.
CborHandle.SetInterfaceExt()seems like the right place, except that a) I don't want to add 55799 tags when I encode, and b) I want to be able to strip a 55799 tag in any location, on any item encoding any type. But adding a handler forinterface{}seems like it breaks too many assumptions.Is it possible to a) achieve this using existing codec features? or b) allow codec to (optionally) silently strip all 55799 tags when decoding?
(For context, my use case is implementing a Dhall library; it has defined CBOR semantics here, including the possibility of tag 55799 appearing anywhere.)