Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Bella Khizgiyaev <[email protected]>
  • Loading branch information
bkhizgiy authored and ahadas committed Mar 12, 2024
1 parent cf2a489 commit 7e89b87
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions virt-v2v/cold/entrypoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,9 @@ func isValidSource(source string) bool {
}

func addFirmwareToXml(filePath string) (err error) {
var newFirmwareData string
if firmware == "bios" {
newFirmwareData = (` <firmware>
<bootloader type='bios'/>
</firmware>`)
} else {
newFirmwareData = (` <firmware>
<bootloader type='efi'/>
</firmware>`)
}
newFirmwareData := fmt.Sprintf(` <firmware>
<bootloader type='%s'/>
</firmware>`, firmware)

file, err := os.Open(filePath)
if err != nil {
Expand All @@ -330,8 +323,7 @@ func addFirmwareToXml(filePath string) (err error) {
for scanner.Scan() {
line := scanner.Text()

_, err = tempFile.WriteString(line + "\n")
if err != nil {
if _, err = tempFile.WriteString(line + "\n"); err != nil {
return
}

Expand Down

0 comments on commit 7e89b87

Please sign in to comment.