mirror of
https://github.com/golang/go.git
synced 2025-10-19 11:03:18 +00:00
cmd/covdata: close output meta-data file
Signed-off-by: guoguangwu <guoguangwug@gmail.com>
This commit is contained in:
parent
01ba8bfe86
commit
62e22b309d
1 changed files with 6 additions and 0 deletions
|
@ -241,6 +241,12 @@ func (mm *metaMerge) emitMeta(outdir string, pcombine bool) [16]byte {
|
||||||
fatal("unable to open output meta-data file %s: %v", fpath, err)
|
fatal("unable to open output meta-data file %s: %v", fpath, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
if err := mf.Close(); err != nil {
|
||||||
|
fatal("error closing output meta-data file %s: %v", fpath, err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
// Encode and write.
|
// Encode and write.
|
||||||
mfw := encodemeta.NewCoverageMetaFileWriter(fpath, mf)
|
mfw := encodemeta.NewCoverageMetaFileWriter(fpath, mf)
|
||||||
err = mfw.Write(finalHash, blobs, mm.Mode(), mm.Granularity())
|
err = mfw.Write(finalHash, blobs, mm.Mode(), mm.Granularity())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue