|
Matt Harden |
at Jan 7, 2014 at 1:37 am
|
⇧ |
| |
There might be a misunderstanding here. Package encoding/json, like
encoding/xml, does not store type information along with the data in
marshal(). Instead it is designed to use the most natural json encoding to
interoperate with other tools and languages. If you need type information
included in the encoding, you need something like encoding/gob.
On Mon, Jan 6, 2014 at 6:32 PM, Jesse McNelis wrote:On Tue, Jan 7, 2014 at 11:27 AM, Alex Zorin wrote:
Thank you Jesse, I can see why the limitation might be in place.
I'll have to look later to see whether it might be possible to improve
the unmarshaler to determine more precise type information without killing
the performance completely.
If you want a specific type then you need to pass that in to unmarshal.
http://play.golang.org/p/CgumnODUn2--
=====================
http://jessta.id.au--
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
[email protected].
For more options, visit
https://groups.google.com/groups/opt_out. --
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
[email protected].
For more options, visit
https://groups.google.com/groups/opt_out.