panic if can't create report file
This commit is contained in:
parent
5c3f7b2a13
commit
d3472d3788
1 changed files with 4 additions and 1 deletions
|
@ -61,7 +61,10 @@ func coverageHook() vm.OnExecHook {
|
|||
}
|
||||
|
||||
func reportCoverage() {
|
||||
f, _ := os.Create(coverProfile)
|
||||
f, err := os.Create(coverProfile)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("coverage: can't create file '%s' to write coverage report", coverProfile))
|
||||
}
|
||||
defer f.Close()
|
||||
writeCoverageReport(f)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue