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

Does it make sense to include an Add method for adding a new key/value to an existing object? #73

Open
andrewheadricke opened this issue Mar 8, 2020 · 1 comment

Comments

@andrewheadricke
Copy link

Currently I have to convert the cbor node to JSON, then modify the doc as a interface{}, then create a byte reader and pass it back to .FromJSON() to get a new cbor node.

Would it make sense to include an Add() method so I can make my change without all the conversions?

@hsanjuan
Copy link
Contributor

hsanjuan commented Mar 9, 2020

What happens if you .Resolve(nil) (hopefully this gets the root object), then modify, then WrapObject ? Might be able to skip the (explicit) json export. (Perhaps DecodeInto can also help if that does not work).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants