We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OS: window 10 go version: go1.19 windows/amd64 json-iterator: v1.1.12 purpose:unmarshal from 2d array string to 1d array and error will return
type Person struct { Age int64 `json:"age"` Name string `json:"name"` } func TestAnything3(t *testing.T) { var s = `[ [ { "age": 1, "name": "jack" } ] ]` var ps []*Person err := jsoniter.Unmarshal([]byte(s), &ps) fmt.Printf("ps: len:%v\n", len(ps)) fmt.Printf("ps: value:\n") for k, v := range ps { fmt.Printf("k:%v, v:%v\n", k, v) } fmt.Printf("err: %v\n", err) }
result: === RUN TestAnything3 ps: len:1 ps: value: k:0, v:&{0 } err: nil --- PASS: TestAnything3 (0.00s) PASS
err should not be nil
The text was updated successfully, but these errors were encountered:
No branches or pull requests
OS: window 10
go version: go1.19 windows/amd64
json-iterator: v1.1.12
purpose:unmarshal from 2d array string to 1d array and error will return
err should not be nil
The text was updated successfully, but these errors were encountered: