-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jsonio: Fix parse errors on EOF (#5055)
Fix an issue with jsonio.Reader where parse errors occurring at the end of an input (EOF) are often ignored or return an ambiguous EOF error.
- Loading branch information
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
script: | | ||
while IFS= read -r line; do | ||
! printf "$line" | zq -i json - | ||
done < errors.txt | ||
inputs: | ||
- name: errors.txt | ||
data: | | ||
tru | ||
fal | ||
nu | ||
"3 | ||
["3", | ||
["3" | ||
{"foo": | ||
{"foo":"bar", | ||
{"foo":"bar" | ||
{"foo":"bar | ||
outputs: | ||
- name: stderr | ||
data: | | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
stdio:stdin: unexpected end of JSON input | ||
- name: stdout | ||
data: "" |