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
When processing a batch of comma-separated json, where one/more are incorrect(error expected):
encoding/json
go-json
sample program:
package main import ( stdjson "encoding/json" "fmt" "strings" goccy_json "github.com/goccy/go-json" ) type Test struct { Val int `json:"val"` } func main() { p := Test{} decoder := stdjson.NewDecoder(strings.NewReader("[12,{\"val\" : 2}]")) decoder.Token() for decoder.More() { err := decoder.Decode(&p) fmt.Println("StdJSON:", err) fmt.Println("Value:", p) } decoder2 := goccy_json.NewDecoder(strings.NewReader("[12,{\"val\" : 2}]")) decoder2.Token() for decoder2.More() { err := decoder2.Decode(&p) fmt.Println("Goccy JSON:", err) fmt.Println("Value:", p) } }
StdJSON: json: cannot unmarshal number into Go value of type main.Test Value: {0} StdJSON: <nil> Value: {2}
The text was updated successfully, but these errors were encountered:
Thank you for the reporting. I fix this problem with #297
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
When processing a batch of comma-separated json, where one/more are incorrect(error expected):
encoding/json
- gives error for the incorrect ones, processes the restgo-json
- goes into an infinite loop as soon as it is unable to decode an inputsample program:
encoding/json
:go-json
: infinite loopThe text was updated successfully, but these errors were encountered: