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

documentation: leading 0s #150

Closed
pkoppstein opened this issue Nov 29, 2021 · 3 comments
Closed

documentation: leading 0s #150

pkoppstein opened this issue Nov 29, 2021 · 3 comments

Comments

@pkoppstein
Copy link

pkoppstein commented Nov 29, 2021

jq and gojq handle leading 0s differently. Has this been documented?

$ gojq  . <<< 0862
0
862

$ jq  . <<< 0862
jq  . <<< 0862
862
$

This is definitely worth noting because gojq is somewhat inconsistent in its treatment of leading 0s:

$ gojq -n 0862
862
@itchyny
Copy link
Owner

itchyny commented Nov 29, 2021

This is considered as the instance of difference on the JSON parser strictness. I don't like the jq behavior handles invalid JSONs.

@pkoppstein
Copy link
Author

pkoppstein commented Nov 29, 2021

@itchyny wrote:

This is considered as the instance of difference on the JSON parser strictness.

OK, but I don't see anything about this in the "Difference to jq" section.

Also, is gojq's internal inconsistency noted? Or should that be the subject of a bug report?

@itchyny
Copy link
Owner

itchyny commented Nov 29, 2021

There is no inconsistency because jq query and JSON have different syntax.

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

No branches or pull requests

2 participants