ref: d667411ec9001d314f4a6a0ce153604d32ef9887
parent: d2022eea7ed308d1df19bbd709e1a8011efe7115
author: Runxi Yu <me@runxiyu.org>
date: Mon Mar 9 10:27:19 EDT 2026
format/pack/ingest: Handle error from crc.Write just in case Although, yeah that won't happen
--- a/format/pack/ingest/thin_append.go
+++ b/format/pack/ingest/thin_append.go
@@ -29,7 +29,11 @@
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))
--
⑨