Answer the question
In order to leave comments, you need to log in
How to parse json with changing structure?
VK sends the following response
{"access_token_XXXXXX":"533bacf01e11f55b536a565b57531ac114461ae8736d6506a3", "expires_in":0}
Answer the question
In order to leave comments, you need to log in
jsonSource := `{"access_token_XXXXXX":"533bacf01e11f55b536a565b57531ac114461ae8736d6506a3", "expires_in":0}`
var raw map[string]interface{}
err := json.Unmarshal([]byte(jsonSource), &raw)
if err != nil {
log.Fatal(err)
}
for key, val := range raw {
fmt.Printf("%s: %v\n", key, val)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question