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 parsing a json.Number that is null, the standard library will set it to an empty string, whereas go-json will return a parseFloat error.
Reproduction below:
package main import ( standardJson "encoding/json" goccyJson "github.com/goccy/go-json" ) type Category struct { ID standardJson.Number `json:"id,number"` ParentID standardJson.Number `json:"parent_id,number"` } const input = `{"id": "123", "parent_id": null}` func main() { catGoccy := &Category{} catStandard := &Category{} errStandard := standardJson.Unmarshal([]byte(input), catStandard) if errStandard != nil { panic(errStandard) } errGoccy := goccyJson.Unmarshal([]byte(input), catGoccy) if errGoccy != nil { panic(errGoccy) } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When parsing a json.Number that is null, the standard library will set it to an empty string, whereas go-json will return a parseFloat error.
Reproduction below:
The text was updated successfully, but these errors were encountered: