I am trying to implement in my application a way to separate users per country and then, send them to different actions.
This is what I have right now:
var manyUsers zendesk.ManyUsers
users := make(map[string]zendesk.ManyUsers)
for {
...
manyUsers.AppendUsers(mysqlRequest(country, id))
users[country] = manyUsers
fmt.Printf("[%s]: %#v
", country, users[country])
}
But I figure out that after when I add a 3 different countries, it will generate 3 diferent keys, but the last one will have the 3 users from the other countries.
This is my AppendUsers function
func (users *ManyUsers) AppendUsers(user User) []User {
users.Users = append(users.Users, user)
return users.Users
}