Unmarshaling nested JSON objects

后端 未结 8 1813
轻奢々
轻奢々 2020-11-27 11:37

There are a few questions on the topic but none of them seem to cover my case, thus I\'m creating a new one.

I have JSON like the following:

{\"foo\"         


        
8条回答
  •  无人及你
    2020-11-27 11:53

    Yes. With gjson all you have to do now is:

    bar := gjson.Get(json, "foo.bar")

    bar could be a struct property if you like. Also, no maps.

提交回复
热议问题