mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Fix errors with gofmt compliance
This commit is contained in:
parent
6d6487e288
commit
8e538b68ec
@ -67,7 +67,6 @@ func resourceVSphereFolderCreate(d *schema.ResourceData, meta interface{}) error
|
||||
return resourceVSphereFolderRead(d, meta)
|
||||
}
|
||||
|
||||
|
||||
func createFolder(client *govmomi.Client, f *folder) error {
|
||||
|
||||
finder := find.NewFinder(client.Client, true)
|
||||
@ -113,7 +112,6 @@ func createFolder(client *govmomi.Client, f *folder) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
func resourceVSphereFolderRead(d *schema.ResourceData, meta interface{}) error {
|
||||
|
||||
log.Printf("[DEBUG] reading folder: %#v", d)
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
"github.com/hashicorp/terraform/terraform"
|
||||
"github.com/vmware/govmomi"
|
||||
@ -171,7 +170,6 @@ func testAccCheckVSphereFolderExists(n string, f *folder) resource.TestCheckFunc
|
||||
|
||||
_, err = object.NewSearchIndex(client.Client).FindChild(context.TODO(), dcFolders.VmFolder, rs.Primary.Attributes["path"])
|
||||
|
||||
|
||||
*f = folder{
|
||||
path: rs.Primary.Attributes["path"],
|
||||
}
|
||||
@ -206,7 +204,6 @@ func testAccCheckVSphereFolderExistingPathExists(n string, f *folder) resource.T
|
||||
|
||||
_, err = object.NewSearchIndex(client.Client).FindChild(context.TODO(), dcFolders.VmFolder, rs.Primary.Attributes["existing_path"])
|
||||
|
||||
|
||||
*f = folder{
|
||||
path: rs.Primary.Attributes["path"],
|
||||
}
|
||||
@ -235,7 +232,7 @@ func createVSphereFolder(datacenter string, folder_name string) error {
|
||||
|
||||
client := testAccProvider.Meta().(*govmomi.Client)
|
||||
|
||||
f := folder{path: folder_name, datacenter: datacenter,}
|
||||
f := folder{path: folder_name, datacenter: datacenter}
|
||||
|
||||
folder, err := object.NewSearchIndex(client.Client).FindByInventoryPath(
|
||||
context.TODO(), fmt.Sprintf("%v/vm/%v", datacenter, folder_name))
|
||||
@ -254,7 +251,7 @@ func createVSphereFolder(datacenter string, folder_name string) error {
|
||||
|
||||
func removeVSphereFolder(datacenter string, folder_name string, existing_path string) resource.TestCheckFunc {
|
||||
|
||||
f := folder{path: folder_name, datacenter: datacenter, existingPath: existing_path,}
|
||||
f := folder{path: folder_name, datacenter: datacenter, existingPath: existing_path}
|
||||
|
||||
return func(s *terraform.State) error {
|
||||
|
||||
|
@ -344,7 +344,6 @@ func testAccCheckVSphereVirtualMachineDestroy(s *terraform.State) error {
|
||||
return fmt.Errorf("error %s", err)
|
||||
}
|
||||
|
||||
|
||||
folder := dcFolders.VmFolder
|
||||
if len(rs.Primary.Attributes["folder"]) > 0 {
|
||||
si := object.NewSearchIndex(client.Client)
|
||||
@ -370,7 +369,6 @@ func testAccCheckVSphereVirtualMachineDestroy(s *terraform.State) error {
|
||||
func testAccCheckVSphereVirtualMachineExistsHasCustomConfig(n string, vm *virtualMachine) resource.TestCheckFunc {
|
||||
return func(s *terraform.State) error {
|
||||
|
||||
|
||||
rs, ok := s.RootModule().Resources[n]
|
||||
if !ok {
|
||||
return fmt.Errorf("Not found: %s", n)
|
||||
@ -393,7 +391,6 @@ func testAccCheckVSphereVirtualMachineExistsHasCustomConfig(n string, vm *virtua
|
||||
return fmt.Errorf("error %s", err)
|
||||
}
|
||||
|
||||
|
||||
_, err = object.NewSearchIndex(client.Client).FindChild(context.TODO(), dcFolders.VmFolder, rs.Primary.Attributes["name"])
|
||||
if err != nil {
|
||||
return fmt.Errorf("error %s", err)
|
||||
@ -493,7 +490,6 @@ func testAccCheckVSphereVirtualMachineExists(n string, vm *virtualMachine) resou
|
||||
|
||||
_, err = object.NewSearchIndex(client.Client).FindChild(context.TODO(), folder, rs.Primary.Attributes["name"])
|
||||
|
||||
|
||||
*vm = virtualMachine{
|
||||
name: rs.Primary.ID,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user