aboutsummaryrefslogtreecommitdiff
path: root/format
diff options
context:
space:
mode:
authorGravatar Runxi Yu2026-03-09 14:27:19 +0800
committerGravatar Runxi Yu2026-03-09 14:27:19 +0800
commitd667411ec9001d314f4a6a0ce153604d32ef9887 (patch)
treedceab397151be8b0709f14dc44d7156bc921ef88 /format
parentinternal: Rename internal.go -> doc.go (diff)
signatureNo signature
format/pack/ingest: Handle error from crc.Write just in case
Although, yeah that won't happen
Diffstat (limited to 'format')
-rw-r--r--format/pack/ingest/thin_append.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/format/pack/ingest/thin_append.go b/format/pack/ingest/thin_append.go
index ad2d33d1..14ba41bd 100644
--- a/format/pack/ingest/thin_append.go
+++ b/format/pack/ingest/thin_append.go
@@ -29,7 +29,11 @@ func appendBaseObject(state *ingestState, id objectid.ObjectID, realType objectt
headerLenInt64 := int64(len(header))
section := &fileSectionWriter{file: state.packFile, off: startInt64 + headerLenInt64}
crc := crc32.NewIEEE()
- _, _ = crc.Write(header)
+ _, err = crc.Write(header)
+ if err != nil {
+ return 0, err
+ }
+
counting := &countingWriter{dst: section}
zw := zlib.NewWriter(io.MultiWriter(counting, crc))