Open 0xc1f opened 3 years ago
Currently, the embedded struct (within the parent struct) with a fields will also be encoded as a CBOR map. What if to involve a struct tag (for example, 'embed') which usage will trigger the inner fields (and kv of Go map as well) embedding of the target embedded struct to the parent struct on encoding?
I'm working on the COSE library with built-in CWT support by using your powerful library. I would like to have the ability to embed the map keys (with their corresponding values) in to the parent struct definition (for example, by specific tag or the conditional mix of them). The idea is to keep the key type by using the specific tag (keyasint) within the parent structure on the anonymous embedded map type. PR's are welcome? :)