mholt / json-to-go

Translates JSON into a Go type in your browser instantly (original)
https://mholt.github.io/json-to-go/
MIT License
4.51k stars 475 forks source link

Bug with nested arrays #18

Closed yanpozka closed 7 years ago

yanpozka commented 8 years ago

I tried to answer this question in StackOverFlow with json-to-go, but I've found a bug, this json [[[{"abc": "a1"}]]] has to be converted as slice of slices:

type AutoGenerated [][][]struct {
    Abc string `json:"abc"`
}
// or
type AutoGenerated [][]interface{}

To be corrected Unmarshal() like here

mholt commented 7 years ago

Thanks to @ShevaXu, I think this is now fixed. :)