Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
encoding/json: unsupported value: NaN #25721
Bot closed the previous issue ( #3480 ), just reminding problem still exists
What version of Go are you using (
@mvdan yes I did, and I'm aware that it is pretty messy issue, but IMO just having to deal with NaN being either NaN, inf+ or inf- is better than having ser/des of one document fail because of single (and, currently, hard to find) NaN.
From my experience with other libs in other languages most of them just chose to break strict adherence to JSON
And currently Go is also breaking the standard, just in other way, err'ing out when it should just return string "null", and err'ing out on ingestion with no option to opt out.
Maybe adding additional struct options would help? Like: