francoispqt / gojay

high performance JSON encoder/decoder with stream API for Golang
MIT License
2.11k stars 112 forks source link

Add support for negative floats with 0 significand #55

Closed lorenzo-stoakes closed 6 years ago

lorenzo-stoakes commented 6 years ago

Previously, floating point numbers of the form -0.1234..., i.e. those with a 0 significand would result in a 'wrong char' error.

These are valid numbers in JSON under RFC 4627 so we should support them. This patch adds this support and a test for both float64 and float32.

codecov-io commented 6 years ago

Codecov Report

Merging #55 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #55   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          30     30           
  Lines        3537   3537           
=====================================
  Hits         3537   3537
Impacted Files Coverage Δ
decode_number_float.go 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 71c0966...2aae61b. Read the comment docs.

francoispqt commented 6 years ago

Merged, thanks