Skip to content

Commit 0c0e65f

Browse files
committed
block: fix linter failure when CGO is disabled
1 parent 3958d45 commit 0c0e65f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sstable/block/compressor_nocgo.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ func (zstdCompressor) Compress(compressedBuf, b []byte) (CompressionIndicator, [
4040
}
4141
varIntLen := binary.PutUvarint(compressedBuf, uint64(len(b)))
4242
encoder, _ := zstd.NewWriter(nil)
43-
defer encoder.Close()
44-
return ZstdCompressionIndicator, encoder.EncodeAll(b, compressedBuf[:varIntLen])
43+
result := encoder.EncodeAll(b, compressedBuf[:varIntLen])
44+
if err := encoder.Close(); err != nil {
45+
panic(err)
46+
}
47+
return ZstdCompressionIndicator, result
4548
}
4649

4750
func (zstdCompressor) Close() {}

0 commit comments

Comments
 (0)