francoispqt / gojay

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

fix cases where malformed numbers can cause panic #33

Closed francoispqt closed 6 years ago

codecov-io commented 6 years ago

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #33   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          30     30           
  Lines        3388   3421   +33     
=====================================
+ Hits         3388   3421   +33
Impacted Files Coverage Δ
decode_number.go 100% <100%> (ø) :arrow_up:
decode_number_int.go 100% <100%> (ø) :arrow_up:
decode_number_uint.go 100% <100%> (ø) :arrow_up:
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 7166fd6...16474fe. Read the comment docs.

francoispqt commented 6 years ago

Took the opportunity to change how uints were treating negative numbers. Negative JSON numbers will now cause InvalidUnmarshalError when trying to unmarshal to uint type. This is inline with encoding/json package.