type Person struct {
Example []struct {
Firstname string `json:"firstname"`
Lastname string `json:"lastname"`
Address []struct {
Street string `json:"street"`
City string `json:"city"`
Zip string `json:"zip"`
Country string `json:"country"`
} `json:"address"`
Age string `json:"age"`
} `json:"users"`
}
I am making a function in go that is going to take a name and I'm going to iterate through my json file that has multiple people and return the person that matches the name that is passed. However, for my purposes, I need to return the Example struct, and I do not know how to specify the return type to be an Example struct. I would prefer if I did not have to separate into multiple structures as I'm doing a variety of tasks with the aforementioned code.