-
Notifications
You must be signed in to change notification settings - Fork 54
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
jq: add option to pretty print JSON output #116
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good, but I would propose one addition that would make this more flexible to use.
Adds a new function `EvaluateFormatted` to maintain backward compatibility; colorizing is handled by pkg/jsonpretty in this repository.
d3a4294
to
ffc3dcc
Compare
@mislav: thanks for the update there, it shows how green I am around my GoLang ears here. |
No worries and you're welcome. Your solution wasn't perfectly fine. My approach ins't necessarily less code but I think it might be easier to read and comprehend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Well, I care a lot about readability, and the whole encoder setup was not giving me the 'this code just fits' feeling yet. I like the approach you took because that is a lot more readable. I've made note, so thanks again! |
Adds a new function
EvaluateFormatted
to maintain backward compatibility.Indenting output by 2 spaces matches jq output.
Needed for cli/cli#3994