need to initialize variables scoped to the individual loop, because the address of k,v stay the same and that means we overwrite previous variables when assigning them to the struct directly.

pull/8284/head
Megan Marsh 6 years ago
parent 5ab31b0363
commit e2283445f2

@ -8,9 +8,11 @@ import (
func buildEc2Filters(input map[string]string) []*ec2.Filter {
var filters []*ec2.Filter
for k, v := range input {
a := k
b := v
filters = append(filters, &ec2.Filter{
Name: &k,
Values: []*string{&v},
Name: &a,
Values: []*string{&b},
})
}
return filters

Loading…
Cancel
Save