From f9875c4ae148b26da8b679bf18d2a997f7aaae88 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet <105649352+lbajolet-hashicorp@users.noreply.github.com> Date: Wed, 2 Aug 2023 11:05:57 -0400 Subject: [PATCH] bump go 1.18 to 1.19 (#106) * go.mod: bump go version from 1.18 to 1.19 * go: lint all go files --- builder/hyperv/common/driver_ps_4.go | 6 +++--- builder/hyperv/common/powershell/hyperv/hyperv.go | 1 - builder/hyperv/common/step_clone_vm.go | 3 ++- builder/hyperv/common/step_create_external_switch.go | 3 ++- builder/hyperv/common/step_create_switch.go | 3 ++- builder/hyperv/common/step_create_vm.go | 3 ++- builder/hyperv/common/step_resize_vhd.go | 1 - builder/hyperv/common/step_shutdown.go | 12 +++++++----- builder/hyperv/vmcx/builder_test.go | 2 +- go.mod | 2 +- 10 files changed, 20 insertions(+), 16 deletions(-) diff --git a/builder/hyperv/common/driver_ps_4.go b/builder/hyperv/common/driver_ps_4.go index 453927a1..9a4b83af 100644 --- a/builder/hyperv/common/driver_ps_4.go +++ b/builder/hyperv/common/driver_ps_4.go @@ -140,12 +140,12 @@ func (d *HypervPS4Driver) GetVirtualMachineNetworkAdapterAddress(vmName string) return hyperv.GetVirtualMachineNetworkAdapterAddress(vmName) } -//Set the vlan to use for switch +// Set the vlan to use for switch func (d *HypervPS4Driver) SetNetworkAdapterVlanId(switchName string, vlanId string) error { return hyperv.SetNetworkAdapterVlanId(switchName, vlanId) } -//Set the vlan to use for machine +// Set the vlan to use for machine func (d *HypervPS4Driver) SetVirtualMachineVlanId(vmName string, vlanId string) error { return hyperv.SetVirtualMachineVlanId(vmName, vlanId) } @@ -154,7 +154,7 @@ func (d *HypervPS4Driver) SetVmNetworkAdapterMacAddress(vmName string, mac strin return hyperv.SetVmNetworkAdapterMacAddress(vmName, mac) } -//Replace the network adapter with a (non-)legacy adapter +// Replace the network adapter with a (non-)legacy adapter func (d *HypervPS4Driver) ReplaceVirtualMachineNetworkAdapter(vmName string, virtual bool) error { return hyperv.ReplaceVirtualMachineNetworkAdapter(vmName, virtual) } diff --git a/builder/hyperv/common/powershell/hyperv/hyperv.go b/builder/hyperv/common/powershell/hyperv/hyperv.go index 6658cf41..d95fe0d6 100644 --- a/builder/hyperv/common/powershell/hyperv/hyperv.go +++ b/builder/hyperv/common/powershell/hyperv/hyperv.go @@ -327,7 +327,6 @@ Hyper-V\Set-VMFloppyDiskDrive -VMName $vmName -Path $null // // For examples of what this template will generate, you can look at the // test cases in ./hyperv_test.go -// func getCreateVMScript(opts *scriptOptions) (string, error) { if opts.FixedVHD && opts.Generation == 2 { diff --git a/builder/hyperv/common/step_clone_vm.go b/builder/hyperv/common/step_clone_vm.go index d14b9ea3..98421378 100644 --- a/builder/hyperv/common/step_clone_vm.go +++ b/builder/hyperv/common/step_clone_vm.go @@ -17,7 +17,8 @@ import ( // This step clones an existing virtual machine. // // Produces: -// VMName string - The name of the VM +// +// VMName string - The name of the VM type StepCloneVM struct { CloneFromVMCXPath string CloneFromVMName string diff --git a/builder/hyperv/common/step_create_external_switch.go b/builder/hyperv/common/step_create_external_switch.go index 874e7177..74e43f61 100644 --- a/builder/hyperv/common/step_create_external_switch.go +++ b/builder/hyperv/common/step_create_external_switch.go @@ -15,7 +15,8 @@ import ( // This step creates an external switch for the VM. // // Produces: -// SwitchName string - The name of the Switch +// +// SwitchName string - The name of the Switch type StepCreateExternalSwitch struct { SwitchName string oldSwitchName string diff --git a/builder/hyperv/common/step_create_switch.go b/builder/hyperv/common/step_create_switch.go index ae94344f..e8587781 100644 --- a/builder/hyperv/common/step_create_switch.go +++ b/builder/hyperv/common/step_create_switch.go @@ -20,7 +20,8 @@ const ( // This step creates switch for VM. // // Produces: -// SwitchName string - The name of the Switch +// +// SwitchName string - The name of the Switch type StepCreateSwitch struct { // Specifies the name of the switch to be created. SwitchName string diff --git a/builder/hyperv/common/step_create_vm.go b/builder/hyperv/common/step_create_vm.go index 94b15a55..631ff43f 100644 --- a/builder/hyperv/common/step_create_vm.go +++ b/builder/hyperv/common/step_create_vm.go @@ -17,7 +17,8 @@ import ( // This step creates the actual virtual machine. // // Produces: -// VMName string - The name of the VM +// +// VMName string - The name of the VM type StepCreateVM struct { VMName string SwitchName string diff --git a/builder/hyperv/common/step_resize_vhd.go b/builder/hyperv/common/step_resize_vhd.go index 507c14b5..bf46db1f 100644 --- a/builder/hyperv/common/step_resize_vhd.go +++ b/builder/hyperv/common/step_resize_vhd.go @@ -12,7 +12,6 @@ import ( ) // This resizes the first vhd on the virtual machine to the specified DiskSize (in MB) -// type StepResizeVhd struct { DiskSize *uint } diff --git a/builder/hyperv/common/step_shutdown.go b/builder/hyperv/common/step_shutdown.go index cb40be57..e3f126a4 100644 --- a/builder/hyperv/common/step_shutdown.go +++ b/builder/hyperv/common/step_shutdown.go @@ -19,13 +19,15 @@ import ( // but ultimately forcefully shuts it down if that fails. // // Uses: -// communicator packersdk.Communicator -// driver Driver -// ui packersdk.Ui -// vmName string +// +// communicator packersdk.Communicator +// driver Driver +// ui packersdk.Ui +// vmName string // // Produces: -// +// +// type StepShutdown struct { Command string Timeout time.Duration diff --git a/builder/hyperv/vmcx/builder_test.go b/builder/hyperv/vmcx/builder_test.go index b37a0651..170ed91f 100644 --- a/builder/hyperv/vmcx/builder_test.go +++ b/builder/hyperv/vmcx/builder_test.go @@ -149,7 +149,7 @@ func TestBuilderPrepare_ExportedMachinePathExists(t *testing.T) { } } -//nolint +// nolint func disabled_TestBuilderPrepare_CloneFromVmSettingUsedSoNoCloneFromVmcxPathRequired(t *testing.T) { var b Builder config := testConfig() diff --git a/go.mod b/go.mod index 36bc57fa..d7b77fe9 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hashicorp/packer-plugin-hyperv -go 1.18 +go 1.19 require ( github.com/hashicorp/hcl/v2 v2.13.0