If I need to read some json which could be

{ 
   "tag": "number",
   "value": 1
}

or 

{
   "tag": "object",
   "value": {
       "a": 1,
       "b": 2
   }
}

what is the best way to unmarshall it?

I could unmarshall into 

struct {
   Tag string
   Val interface{}
}

But once I have read the data, I would want to convert Val into a int, or a 
struct.

What is the least ugly way to achieve this?

Thanks,
   Amnon

-- 
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