Failed to encode json:unsupported value

I can confirm that division by zero in floats can produce NaN, +Inf, -Inf.
https://play.golang.com/p/9jDjcvCwmaq

And these are invalid JSON values.

Looking at the code, I found only one division operation that may cause this, and a zero check has already been added for v1.73, which will be rolled out soon.

4 Likes