Converts arbitrary JSON data to CSV. Does it make sense? Not always, but it can be useful for the right use-case :)
Usage:
func main() {
json2csv.Convert(strings.NewReader(`[
{
"foo": "bar",
"baz": [{"a":"b"}, 1, 1.3]
},
{
"foo": "fi fum",
"baz": [{"a":"c"}, 3],
"extra": "fine"
},
"it's JSON, what do you expect?"
]`), os.Stdout)
// Output:
// baz.0.a,baz.1,baz.2,extra,foo,text
// b,1,1.3,,bar,
// c,3,,fine,fi fum,
// ,,,,,"it's JSON, what do you expect?"
}