Yes; I was super frustrated with big integers in JSON & your packages saved 
me big time! Thanks a lot!

On Thursday, August 25, 2016 at 3:19:19 PM UTC+4:30, Ugorji Nwoke wrote:
>
> I just checked the issue you created: 
> https://github.com/ugorji/go/issues/168 . I see you already closed it as 
> an error in your code.
>
> You typically shouldn't have to fork the library and make changes. It is 
> designed that you can achieve most of the customization you need by 
> implementing an interface or configuring a custom (en|de)code function for 
> given types.
>
> Glad it works for you.
>
> On Thursday, August 25, 2016 at 2:39:07 AM UTC-4, dc0d wrote:
>>
>> 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