Skip to content

Commit c5370b7

Browse files
committed
review comments fixes
1 parent 7d6f008 commit c5370b7

File tree

6 files changed

+144
-58
lines changed

6 files changed

+144
-58
lines changed

cmd/distribution/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ func readBlock(reader storage.IndexReader, blockIndex uint32) ([]byte, error) {
6161

6262
func loadInfo(path string) *common.Info {
6363
indexReader, f := getReader(path)
64+
defer f.Close()
65+
6466
result, err := readBlock(indexReader, 0)
6567
if err != nil {
6668
logger.Fatal("error reading block", zap.String("file", path), zap.Error(err))
@@ -86,7 +88,8 @@ func loadInfo(path string) *common.Info {
8688
}
8789

8890
func buildDist(dist *seq.MIDsDistribution, path string, _ *common.Info) {
89-
blocksReader, _ := getReader(path)
91+
blocksReader, f := getReader(path)
92+
defer f.Close()
9093

9194
// skip tokens
9295
blockIndex := uint32(1)

0 commit comments

Comments
 (0)