francoispqt / gojay

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

Gojay's decode_bool.go doesn't handle CRLF correctly #131

Open sgotliv opened 4 years ago

sgotliv commented 4 years ago

It seems that methods assertTrue() and assertFalse() in decode_bool.go [1] do not recognize "\r" (CR) as a legitimate separator so gojay fails to parse json which boolean argument in the last line with trailing CRLF.

{ .... "status": true }

Replacing "\r\n" with just "\n" or completely removing "\r\n" make it work because both "\n" and "}" appear in a list of valid separators.

[1] https://github.com/francoispqt/gojay/blob/master/decode_bool.go#L117