diff options
-rw-r--r-- | libvirt/resource_libvirt_domain.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libvirt/resource_libvirt_domain.go b/libvirt/resource_libvirt_domain.go index 1925b3ac..a3b16792 100644 --- a/libvirt/resource_libvirt_domain.go +++ b/libvirt/resource_libvirt_domain.go @@ -884,7 +884,7 @@ func resourceLibvirtDomainRead(d *schema.ResourceData, meta interface{}) error { } d.Set("running", running) - disks := make([]map[string]interface{}, 0) + var disks []map[string]interface{} for _, diskDef := range domainDef.Devices.Disks { // network drives do not have a volume associated if diskDef.Type == "network" { @@ -934,8 +934,7 @@ func resourceLibvirtDomainRead(d *schema.ResourceData, meta interface{}) error { } } d.Set("disks", disks) - - filesystems := make([]map[string]interface{}, 0) + var filesystems []map[string]interface{} for _, fsDef := range domainDef.Devices.Filesystems { fs := map[string]interface{}{ "accessmode": fsDef.AccessMode, @@ -956,7 +955,7 @@ func resourceLibvirtDomainRead(d *schema.ResourceData, meta interface{}) error { addressesForMac := func(mac string) []string { // look for an ip address and try to match it with the mac address // not sure if using the target device name is a better idea here - addrs := make([]string, 0) + var addrs []string for _, ifaceWithAddr := range ifacesWithAddr { if strings.ToUpper(ifaceWithAddr.Hwaddr) == mac { for _, addr := range ifaceWithAddr.Addrs { @@ -967,7 +966,7 @@ func resourceLibvirtDomainRead(d *schema.ResourceData, meta interface{}) error { return addrs } - netIfaces := make([]map[string]interface{}, 0) + var netIfaces []map[string]interface{} for i, networkInterfaceDef := range domainDef.Devices.Interfaces { // we need it to read old values prefix := fmt.Sprintf("network_interface.%d", i) |