Closed knbr13 closed 1 year ago
@abdullah-alaadine - Create a PR and I'll review it :) Sorry I didn't give much attention to the existing one. I'll try my best to get to it when I can 🙏
okay,
I updated the code to use json.MarshalIndent
, but it turned out, that the tests will fail, because in the tests, the expected value is a json output of hardcoded number of spaces or newlines, so updating the code without updating the tests will fail.
I will try to figure out how to modify the tests in order to test the results regardless of the number of spaces and newlines, then I will create a PR again.
Thanks!
Hi Link-
Wouldn't it be better to utilize
json.MarshalIndent
instead ofjson.Marshal
to enhance the readability of the JSON output?In certain contexts, such as when developing web servers in Go, there can be performance considerations favoring the use of
json.Marshal
due to its lower memory and time overhead. However, for projects likegh-stars
—intended for single-user use rather than handling concurrent requests like a web server—employingjson.MarshalIndent
seems entirely reasonable, doesn't it?Current Output Using
json.Marshal
:Output Using
json.MarshalIndent
: