Remove explicit err var declaration

This commit is contained in:
Davor Kapsa 2019-10-09 13:17:43 +02:00 committed by GitHub
parent c505f1c45e
commit 50262ba0b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -84,8 +84,6 @@ func (s *StepCreateExternalSwitch) Cleanup(state multistep.StateBag) {
ui.Say("Unregistering and deleting external switch...")
var err error = nil
errMsg := "Error deleting external switch: %s"
// connect the vm to the old switch
@ -94,7 +92,7 @@ func (s *StepCreateExternalSwitch) Cleanup(state multistep.StateBag) {
return
}
err = driver.ConnectVirtualMachineNetworkAdapterToSwitch(vmName, s.oldSwitchName)
err := driver.ConnectVirtualMachineNetworkAdapterToSwitch(vmName, s.oldSwitchName)
if err != nil {
ui.Error(fmt.Sprintf(errMsg, err))
return