Use an index loop as range loops over copies, not references
Fixes #1637
This commit is contained in:
parent
e7f274325e
commit
02ebef9031
|
@ -60,12 +60,12 @@ func (b *BlockDevices) Prepare(t *packer.ConfigTemplate) []error {
|
||||||
|
|
||||||
var errs []error
|
var errs []error
|
||||||
for outer, bds := range lists {
|
for outer, bds := range lists {
|
||||||
for i, bd := range bds {
|
for i := 0; i < len(bds); i++ {
|
||||||
templates := map[string]*string{
|
templates := map[string]*string{
|
||||||
"device_name": &bd.DeviceName,
|
"device_name": &bds[i].DeviceName,
|
||||||
"snapshot_id": &bd.SnapshotId,
|
"snapshot_id": &bds[i].SnapshotId,
|
||||||
"virtual_name": &bd.VirtualName,
|
"virtual_name": &bds[i].VirtualName,
|
||||||
"volume_type": &bd.VolumeType,
|
"volume_type": &bds[i].VolumeType,
|
||||||
}
|
}
|
||||||
|
|
||||||
errs := make([]error, 0)
|
errs := make([]error, 0)
|
||||||
|
|
Loading…
Reference in New Issue