diff --git a/decode_float.go b/decode_float.go index 3e1d1cb..47a0cdf 100644 --- a/decode_float.go +++ b/decode_float.go @@ -114,9 +114,6 @@ func (d *floatDecoder) decodeStream(s *stream, p unsafe.Pointer) error { if err != nil { return err } - if !validEndNumberChar[s.char()] { - return errUnexpectedEndOfJSON("float", s.totalOffset()) - } str := *(*string)(unsafe.Pointer(&bytes)) f64, err := strconv.ParseFloat(str, 64) if err != nil { diff --git a/stream_test.go b/stream_test.go index 4be9acb..8fee6cd 100644 --- a/stream_test.go +++ b/stream_test.go @@ -12,6 +12,7 @@ import ( "net" "net/http" "net/http/httptest" + "reflect" "strings" "testing" @@ -186,7 +187,6 @@ func nlines(s string, n int) string { return s } -/* func TestDecoder(t *testing.T) { for i := 0; i <= len(streamTest); i++ { // Use stream without newlines as input, @@ -218,7 +218,6 @@ func TestDecoder(t *testing.T) { } } } -*/ func TestDecoderBuffered(t *testing.T) { r := strings.NewReader(`{"Name": "Gopher"} extra `)