ugorji / go

idiomatic codec and rpc lib for msgpack, cbor, json, etc. msgpack.org[Go]
MIT License
1.86k stars 295 forks source link

Syntax error on empty string (strconv) #253

Closed stefanfransen closed 6 years ago

stefanfransen commented 6 years ago

Hi,

In my use case I have a JSON document with fields that aren't always populated with data. When assigning the float64 type to this field while having an empty field I get the following error. json decode error [pos 57599]: strconv.ParseFloat: parsing "": invalid syntax

In the encoding/json library empty fields with an integer/float type get a 0 as value. Any chance you can add the same behavior to your library?

ugorji commented 6 years ago

Let me look into it in the next few days