Add error check

This commit is contained in:
Davor Kapsa 2019-10-09 15:55:07 +02:00 committed by GitHub
parent c505f1c45e
commit 49e4a2d9ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -283,6 +283,9 @@ Hyper-V\New-VM -Name "{{ .VMName }}" -Path "{{ .Path }}" -MemoryStartupBytes {{
}
final := regex.ReplaceAllString(b.String(), "")
regex, err = regexp.Compile("\n\n")
if err != nil {
return "", err
}
final = regex.ReplaceAllString(final, "\n")
return final, nil