Vasily Romanov
Vasily Romanov
just merged #7 now would compile on windows, but wont work yet
You can use easyjson generator if you declare new separate type for you map: ``` type MyMap map[string]MyStruct ``` and mark it with easyjson generator tag
Easyjson is codegenerator for structs, not for dynamic data with unknown structure. Unmarshal to `map[string]interface{}` directry is impossible, use default encoding/json for it.
Reopen as reminder to add documentation about it
stdlib works in runtime, so it cant try to look various name for fields. easyjson now generates code, which parse only one name per field. camelCase, snake_case or from struct...
easyjson parser and codegen based on reflection, so it wont works on package main files, because they cant be imported by parser. I added this note to readme. Fixing this...
Its impossible to add methods to slice type Try this `type ArrTestType []Test`
```golang //easyjson:json type ItemList []Item //easyjson:json type Item struct { Val int } func TestUnpack() { data := []byte(`[{"Val":1}, {"Val":2}]`) v := ItemList{} v.UnmarshalJSON(data) fmt.Println(v) } ``` This works fine
Withouth `//easyjson:json` dont works, because it's not a struct ( `-all` match structs ). I'll think what can be done here