Running go test ./... with Go 1.17 with the following error:
--- FAIL: TestIsFloat64AJSONInteger (0.00s)
convert_test.go:212:
Error Trace: convert_test.go:212
Error: Should be false
Test: TestIsFloat64AJSONInteger
on line 212 of convert_test.go:
|
assert.False(t, IsFloat64AJSONInteger(math.SmallestNonzeroFloat64/2)) |
It turns out that math.SmallestNonzeroFloat64 / 2 is supposed to return 0 (hence an integer), but before Go 1.17, the value of math.SmallestNonzeroFloat64 was not sufficiently precise, thus returning a non-zero non-integer.
Please see:
for more information.
Many thanks!