-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Regression since dace191 (fix fromjson to keep integer precision (close #172)) #178
Comments
What's the actual problem here? I don't think this is a regression. |
Hmm, I'll reconsider later. Maybe checking |
That is used to throw error on unexpected trailing data, same as jq does: $ jq -n '"{} 123" | fromjson'
jq: error (at <unknown>): Unexpected extra JSON values (while parsing '{} 123')
$ jq -n '"123 abc" | fromjson'
jq: error (at <unknown>): Invalid numeric literal at EOF at line 1, column 7 (while parsing '123 abc')
👍 yes that might be better. The double call to |
Thanks! |
Expose number parse validate functions, will be used later by text format decoders: gojq.ValidNumber(s string) gojq.NormalizeNumber(v json.Number) gojq.NormalizeNumbers(v interface{}) From upstream: Fixes: Regression since dace191 (fix fromjson to keep integer precision (close #172)) (itchyny/gojq#178) otherwise mostly cosmetic and cleanups since last rebase
Same for
"{}asd"
and"[]abc"
. I think we're hitting the support for decoding a stream of JSON values.As I guess we still need to use
UseNumber()
maybe a possible solutions could be something like this:Work fine with
"123 \n"
etc also.The text was updated successfully, but these errors were encountered: