Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: ability to embed the map within the struct #272

Open
0xc1f opened this issue May 16, 2021 · 1 comment
Open

feature: ability to embed the map within the struct #272

0xc1f opened this issue May 16, 2021 · 1 comment
Labels
enhancement New feature or request undecided Final decision hasn't been made yet

Comments

@0xc1f
Copy link

0xc1f commented May 16, 2021

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? :)

123

@fxamacker fxamacker added feature undecided Final decision hasn't been made yet enhancement New feature or request and removed feature labels May 29, 2021
@0xc1f
Copy link
Author

0xc1f commented May 30, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request undecided Final decision hasn't been made yet
Projects
None yet
Development

No branches or pull requests

2 participants