builder/amazon: AmiFilterOptions.GetOwners: avoid taking the address of a loop iterator var (#8417)

GetOwners() always returned a slice of pointers to the last value. Because slice ranging reuses the same local variable.
pull/8433/head
Jon Allie 7 years ago committed by Adrien Delorme
parent 29d6c05ef8
commit c31bbcf4cf

@ -27,7 +27,8 @@ type AmiFilterOptions struct {
func (d *AmiFilterOptions) GetOwners() []*string {
res := make([]*string, 0, len(d.Owners))
for _, owner := range d.Owners {
res = append(res, &owner)
i := owner
res = append(res, &i)
}
return res
}

Loading…
Cancel
Save