-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
I tried converting JSON('string not struct') to CSV but got an Unsupported JSON structure. error

package main
import (
"github.com/yukithm/json2csv"
)
func main() {
as := `[
{
"id": 1,
"name": "foo",
"favorites": {
"fruits": "apple",
"color": "red"
}
},
{
"id": 2,
"name": "bar",
"favorites": {
"fruits": "orange"
}
},
{
"id": 3,
"name": "baz",
"favorites": {
"fruits": "banana",
"color": "yellow"
}
}
]`
csv, err := json2csv.JSON2CSV(as)
if err != nil {
return
}
println(csv)
}Metadata
Metadata
Assignees
Labels
No labels