I have a json string as follows:
j := `{"bvu62fu6dq": {
"name": "john",
"age": 23,
"xyz": "weu33s"
.....
.....}
}`
I want to extract the value of name
and age
from above json string. I looked at this example given at golang site http://play.golang.org/p/YQgzP7KPp9
But my problem is the key in the json on top level is dynamic. That means bvu62fu6dq
is dynamic. I have created struct like this:
type Info struct {
UniqueID map[string]string
}
But not sure how to extract name
and age
. My code is at http://play.golang.org/p/Vbdkd3XIKc