Can you use the json.Number type?

https://play.golang.org/p/pKZeDJHkKK



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