I have following example json:
{
"someObjects": [
{
"value1": "something here"
},
{
"value1": "something else"
}
]
}
I want to count the amount of objects inside the "someObjects" array in golang without using any lib.
The json is there in a string and I do not have the corresponding struct lying around (since it is actually pretty big). How can I count this?
interface{}(in recents versions now is calledanytype). Remember an important thing, golang is a strictly static typed language so the most easy way to do this is over an struct created by yourself and pass it to any of the functions in the json package that lets you unmarshal json's in structs