package main import "fmt" // You may think that you want to rewrite to proper golang structures. // Believe me, you shouldn't. func generateXML(vmName string, online, gui bool, vmNixPath, reginfo, img, sharedDir string) string { devices := "" if gui { devices = guiDevices } qemuParams := ` ` if !online { qemuParams = ` ` } return fmt.Sprintf(xmlTmpl, vmName, vmNixPath, vmNixPath, vmNixPath, reginfo, img, sharedDir, sharedDir, sharedDir, devices, qemuParams) } var guiDevices = `