diff options
author | Duncan Mac-Vicar P <dmacvicar@suse.de> | 2017-11-24 17:09:50 +0100 |
---|---|---|
committer | Duncan Mac-Vicar P <dmacvicar@suse.de> | 2017-11-24 17:56:45 +0100 |
commit | 4fea0870bf634945d4b1f101e49d1193651600b3 (patch) | |
tree | 524d60015caa37fd183a979676d819630562bdd8 | |
parent | 1f6b7508dac80715b794bdd1ab17e8f6141c404d (diff) | |
download | terraform-provider-libvirt-4fea0870bf634945d4b1f101e49d1193651600b3.tar terraform-provider-libvirt-4fea0870bf634945d4b1f101e49d1193651600b3.tar.gz |
Remove intermediate variables in map iteration
-rw-r--r-- | libvirt/resource_libvirt_domain.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libvirt/resource_libvirt_domain.go b/libvirt/resource_libvirt_domain.go index 16b618e2..b5d0fb6d 100644 --- a/libvirt/resource_libvirt_domain.go +++ b/libvirt/resource_libvirt_domain.go @@ -298,9 +298,7 @@ func resourceLibvirtDomainCreate(d *schema.ResourceData, meta interface{}) error var cmdlineArgs []string for i := 0; i < d.Get("cmdline.#").(int); i++ { - cmdlineKey := fmt.Sprintf("cmdline.%d", i) - cmdlineMap := d.Get(cmdlineKey).(map[string]interface{}) - for k, v := range cmdlineMap { + for k, v := range d.Get(fmt.Sprintf("cmdline.%d", i)).(map[string]interface{}) { cmdlineArgs = append(cmdlineArgs, fmt.Sprintf("%s=%v", k, v)) } } |