Merge pull request #8207 from dvrkps/patch-2

Add error check
This commit is contained in:
Adrien Delorme 2019-10-09 16:29:21 +02:00 committed by GitHub
commit 046f94c996
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