jq: add option to pretty print JSON output#116
Conversation
mislav
left a comment
There was a problem hiding this comment.
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. |
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
EvaluateFormattedto maintain backward compatibility.Indenting output by 2 spaces matches jq output.
Needed for cli/cli#3994