mirror of https://github.com/golang/go.git
cmd/covdata: close output meta-data file
Change-Id: Idd2a324eb51ffa3f40cb3df03a82a1d6d882295a
GitHub-Last-Rev: 62e22b309d
GitHub-Pull-Request: golang/go#71993
Reviewed-on: https://go-review.googlesource.com/c/go/+/653140
Reviewed-by: Than McIntosh <thanm@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
2298215f5b
commit
64feded8af
|
|
@ -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)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if err := mf.Close(); err != nil {
|
||||
fatal("error closing output meta-data file %s: %v", fpath, err)
|
||||
}
|
||||
}()
|
||||
|
||||
// Encode and write.
|
||||
mfw := encodemeta.NewCoverageMetaFileWriter(fpath, mf)
|
||||
err = mfw.Write(finalHash, blobs, mm.Mode(), mm.Granularity())
|
||||
|
|
|
|||
Loading…
Reference in New Issue