1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:28:33 -06:00

cmd/cover: check os.Create error im html output

The error was being written over by Execute.

Change-Id: Id5965542bf4d414043fdbe70ee3f2f790728c01d
Reviewed-on: https://go-review.googlesource.com/34954
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Daniel Martí 2017-01-07 18:45:34 +00:00 committed by Brad Fitzpatrick
parent 8b89e95de3
commit 354f9f8b43

View File

@ -67,6 +67,9 @@ func htmlOutput(profile, outfile string) error {
} else {
out, err = os.Create(outfile)
}
if err != nil {
return err
}
err = htmlTemplate.Execute(out, d)
if err == nil {
err = out.Close()