I have an array like this.
[{
"seq" : 2,
"amnt" : 125
},
{
"seq" : 3
"amnt" : 25
},
{
"seq" : 2
"amnt" : 250
}]
I need to fetch objects from this array where seq
is 2.
In Linq we have extensions in which I can put a where condition.
In Go do I need to loop through and get it using for loop
or is there another way?
Please suggest me an optimum way.
Note: The json has many fields, for this example I gave only two.
I'm a new learner of Go.