Skip to content

NewJson: reject trailing data after the first JSON value - #97

Open
team-humaki wants to merge 1 commit into
bitly:masterfrom
team-humaki:newjson-trailing-data
Open

team-humaki wants to merge 1 commit into
bitly:masterfrom
team-humaki:newjson-trailing-data

Conversation

@team-humaki

Copy link
Copy Markdown

Fixes #91.

json.Unmarshal (and Decoder.Decode without a follow-up Token) treats "{"... as the string "{" and ignores the rest. NewJson now fails when extra tokens remain after the first value. Trailing whitespace is still accepted.

@qodo-for-bitly

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review
Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗


Powered by Qodo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

NewJson should fail, but it does not

1 participant