Skip to content

Commit

Permalink
Close package file handle as soon as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ericonr authored and the-maldridge committed May 26, 2020
1 parent 55524aa commit 6d1f83e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/xmandump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ func (d *Dumper) processPackage(ctx context.Context, pkg *xrepo.Package, file st
Error(ctx, "Cannot open file", zap.Error(err))
return err
}
defer logClose(ctx, f)

mime, err := mimetype.DetectFile(file)
if err != nil {
Expand Down Expand Up @@ -410,6 +409,7 @@ scanPackage:
done:
d.recordChange(pkg.FilenameSHA256)

f.Close()
return nil
}

Expand Down

0 comments on commit 6d1f83e

Please sign in to comment.