I was looking for some kind of more human-friendly representation of JSON. @pretty works perfectly, but all the braces, brackets, commas, quotes etc aren't needed.
To my great surprise, apparently YAML is a superset of JSON, and it can often be parsed as-is (with some caveats depending on the parser). This is certainly of no use for inclusion into gjson, but I thought I'd put it here in case someone else was looking for a similar hackjob.
Thanks for gjson Mr. Baker! :blue_heart: I'll close this to keep noise low.
P.S. I'm using yaml.v2 to preserve order. It can be done with v3 just the same by switching out the yaml.MapSlice for an interface{}. RedHat please :pray:
I was looking for some kind of more human-friendly representation of JSON.
@pretty
works perfectly, but all the braces, brackets, commas, quotes etc aren't needed.To my great surprise, apparently YAML is a superset of JSON, and it can often be parsed as-is (with some caveats depending on the parser). This is certainly of no use for inclusion into gjson, but I thought I'd put it here in case someone else was looking for a similar hackjob.
Thanks for gjson Mr. Baker! :blue_heart: I'll close this to keep noise low.
https://go.dev/play/p/wMmwivHWW_U
P.S. I'm using yaml.v2 to preserve order. It can be done with v3 just the same by switching out the
yaml.MapSlice
for aninterface{}
. RedHat please :pray: