Thanks; the problem is I'm using a third party package with lots of 
data-structures and those data is going into CouchDB and deserializing 
would set the IEEE 754 hell loose.

Also the `IntegerAsString` on `codec.JsonHandle` in ugorji package does not 
works - created an issue for that.

I ended up forking the lib and use a custom Int and Int64 everywhere 
(implementing Marshaler and Unmarshaler interfaces).

I hope this problem get solved inside standard lib too.

Thanks;

On Wednesday, August 24, 2016 at 9:33:10 PM UTC+4:30, Ugorji Nwoke wrote:
>
> https://godoc.org/github.com/ugorji/go/codec
> https://github.com/ugorji/go
> package name: github.com/ugorji/go/codec
>
> On Wednesday, August 24, 2016 at 5:30:10 AM UTC-4, dc0d wrote:
>>
>> Is there a JSON package that have these characteristics?
>>
>>
>>    - can marshal numeric integer values to strings (like 
>>    using `json:",string"` tag)
>>    - can unmarshal  numeric integer values from *either* string or the 
>>    number; based on the type of the field (some field like `MessageID int64`)
>>
>> Why? Because IEEE 754 is really annoying and JSON standard treats all 
>> numeric values as `float64`. So when a big integer number (a big `int64` 
>> for example) gets serialized - which does perfectly - it can not get 
>> deserialized.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to