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
This library cannot parse [{}] to an interface{} while encoding/json can.
[{}]
interface{}
encoding/json
Run the following code.
package main import ( "fmt" "log" "strings" // "encoding/json" "github.com/goccy/go-json" ) func main() { var v interface{} const src = `[{}]` if err := json.Unmarshal([]byte(src), &v); err != nil { log.Fatal(err) } fmt.Printf("%#v\n", v) dec := json.NewDecoder(strings.NewReader(src)) if err := dec.Decode(&v); err != nil { log.Fatal(err) } fmt.Printf("%#v\n", v) }
[]interface {}{map[string]interface {}{}} 2020/12/26 13:56:03 json: slice unexpected end of JSON input
[]interface {}{map[string]interface {}{}} []interface {}{map[string]interface {}{}}
just like encoding/json does.
The text was updated successfully, but these errors were encountered:
Thanks for the reporting issue. This problem already have fixed at master branch, so I released v0.1.17 by latest commit .
Sorry, something went wrong.
Oops, sorry about that. I confirmed the fix so closing.
No branches or pull requests
Description
This library cannot parse
[{}]
to aninterface{}
whileencoding/json
can.How to reproduce
Run the following code.
What I get
What I expect
just like
encoding/json
does.Environment
The text was updated successfully, but these errors were encountered: