Golang app to read a directory of JSON files & parse an array
Budget: $10 – $30 USD
I need golang code to read every JSON file in the current directory, parse an array, and print the values for specific fields.
Here is an example of a JSON files (test1.json):
{
"items": [
{
"state": "NV",
"first": "Joe",
"last": "Friday"
},
{
"state": "NV",
"first": "Tim",
"last": "Martin"
},
{
"state": "NV",
"first": "Jeff",
"last": "Saturday"
}
]
}
For each file, the code should print the file name, and iterate over each entry in the array and print the values for first and last.
The following output is expected given the example file above:
Values for test.json:
first = Joe
last = Friday
first = Tim
last = Martin
first = Jeff
last = Saturday
Here is an example of a JSON files (test1.json):
{
"items": [
{
"state": "NV",
"first": "Joe",
"last": "Friday"
},
{
"state": "NV",
"first": "Tim",
"last": "Martin"
},
{
"state": "NV",
"first": "Jeff",
"last": "Saturday"
}
]
}
For each file, the code should print the file name, and iterate over each entry in the array and print the values for first and last.
The following output is expected given the example file above:
Values for test.json:
first = Joe
last = Friday
first = Tim
last = Martin
first = Jeff
last = Saturday