phoneNumbers := []string{}
db.Select("DISTINCT phone_number").Where("name IN (?)", names).Find(&Client{}).Pluck("phone_number", &phoneNumbers)
...results in an array of empty strings.
should like this?
db.Where("name IN (?)", names).Find(&Client{}).Pluck("DISTINCT phone_number", &phoneNumbers)
Seems to work, thanks! Though it would be nice if it worked both ways. It's really easy to make this kind of mistake and it's only discovered if tests cover this.
Most helpful comment
Seems to work, thanks! Though it would be nice if it worked both ways. It's really easy to make this kind of mistake and it's only discovered if tests cover this.