K
K
Konstantin Dovnar2017-04-07 15:44:49
go
Konstantin Dovnar, 2017-04-07 15:44:49

Getting nested JSON in Go?

The Go standard library has a module for working with JSON, which is great.
But such is the case - JSON is very often nested and it is far from always done wisely, as an example:

{
    "followers": {
        "count": 999
    }
}

That is, in this case, the use of a nested value is not particularly justified, but it is such and there is nothing to be done.
The question is - is it possible to get such nested values ​​using the json tag in a struct? `json:"followers.count"` or something like that.
Yes, you can use nested structures, but this is a matter of aesthetics, beauty, and other magical things, because to keep the structure in the structure for the sake of one field is somehow not necessary at all.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
akzhan, 2017-04-07
@SolidlSnake

No

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question