Answer the question
In order to leave comments, you need to log in
How to parse multilevel json in GO?
there is a line {"data":{"id":7548,"name":"Ralph"}}
tell me how to get the value of data.name, i.e. "Ralph"
If json is single-level, then everything is obtained by creating a structure with two levels and no longer exits.
Answer the question
In order to leave comments, you need to log in
https://play.golang.org/p/7XBu5nEpJS
Alternatively, use https://github.com/tidwall/gjson
It is optional to use the structure
https://play.golang.org/p/PxaisvjMfM
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question