Skip to content

encoding/json: calculate correct SyntaxError.Offset in the stream #48950

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

Closed
wants to merge 1 commit into from

Conversation

AlexanderYastrebov
Copy link
Contributor

@AlexanderYastrebov AlexanderYastrebov commented Oct 13, 2021

Stream decoder does not count whitespaces, empty objects and arrays
in syntax error offset. This change removes offset tracking from the
scanner and relies on the calling code to provide the correct value.

Fixes #44811, #34543

@google-cla google-cla bot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Oct 13, 2021
@gopherbot
Copy link
Contributor

This PR (HEAD: 3df3888) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/355729 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

Stream decoder does not count whitespaces, empty objects and arrays
in syntax error offset. This change removes offset tracking from the
scanner and relies on the calling code to provide the correct value.

Fixes golang#44811, golang#34543
@gopherbot
Copy link
Contributor

This PR (HEAD: 47e6224) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/355729 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Alexander Yastrebov:

Patch Set 2:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/355729.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Alexander Yastrebov:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/355729.
After addressing review feedback, remember to publish your drafts!

@AlexanderYastrebov
Copy link
Contributor Author

Abandoning due to no review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

encoding/json: SyntaxError.Offset is wrong when decoding stream
2 participants