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

Read bytes #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Read bytes #56

wants to merge 2 commits into from

Conversation

morphy2k
Copy link

Adds functions to accept JSON and YAML in bytes to avoid unnecessary conversion in some cases.

The motivation behind this is a tool I wrote in which I have JSON as bytes.

@josephburnett
Copy link
Owner

Thanks for the pull request! I'd like to know a little more about your use case. Are you serializing to JSON right before passing to JD? I think the conversion between bytes and string doesn't actually cost anything in terms of cpu time or memory space. However if you're regularly diffing object, you might have to serialize to JSON, check for errors, then pass to JD. I could see a ReadJSONBytes function that also check the error for you, so could do something like: jd.ReadJSONBytes(json.Marshal(object)). But in that case, we might prefer something that will do that Marshal for you.

Anyway, tell me a little more about your needs or maybe a few code examples. Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants