I am new to golang, and got stuck at this. I have an array of structure:
Users []struct {
UserName string
Category string
Age string
}
I want to retrieve all the UserName from this array of structure. So, output would be of type:
UserList []string
I know the brute force method of using a loop to retrieve the elements manually and constructing an array from that. Is there any other way to do this?