diff --git a/virt-v2v/cold/entrypoint.go b/virt-v2v/cold/entrypoint.go index 626ea9a7a..bf9aec780 100644 --- a/virt-v2v/cold/entrypoint.go +++ b/virt-v2v/cold/entrypoint.go @@ -300,16 +300,9 @@ func isValidSource(source string) bool { } func addFirmwareToXml(filePath string) (err error) { - var newFirmwareData string - if firmware == "bios" { - newFirmwareData = (` - - `) - } else { - newFirmwareData = (` - - `) - } + newFirmwareData := fmt.Sprintf(` + + `, firmware) file, err := os.Open(filePath) if err != nil { @@ -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 }