From 6be32e9cf14a43cf6fb78a29943cb3b0e3d276b2 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 21 Feb 2026 23:21:32 +0800 Subject: internal/zlib: Use klauspost/compress/flate for now... --- go.mod | 2 ++ go.sum | 2 ++ internal/zlib/reader.go | 3 ++- internal/zlib/writer.go | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 go.sum diff --git a/go.mod b/go.mod index 2ea5559f..0fd9e922 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,5 @@ module codeberg.org/lindenii/furgit go 1.25.0 + +require github.com/klauspost/compress v1.18.4 diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..1ef647c0 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/klauspost/compress v1.18.4 h1:RPhnKRAQ4Fh8zU2FY/6ZFDwTVTxgJ/EMydqSTzE9a2c= +github.com/klauspost/compress v1.18.4/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= diff --git a/internal/zlib/reader.go b/internal/zlib/reader.go index 6e70fdea..60383ee1 100644 --- a/internal/zlib/reader.go +++ b/internal/zlib/reader.go @@ -35,13 +35,14 @@ package zlib import ( "bufio" - "compress/flate" "encoding/binary" "errors" "hash" "hash/adler32" "io" "sync" + + "github.com/klauspost/compress/flate" ) const ( diff --git a/internal/zlib/writer.go b/internal/zlib/writer.go index 5497f089..608e35f2 100644 --- a/internal/zlib/writer.go +++ b/internal/zlib/writer.go @@ -5,13 +5,14 @@ package zlib import ( - "compress/flate" "encoding/binary" "fmt" "hash" "hash/adler32" "io" "sync" + + "github.com/klauspost/compress/flate" ) // These constants are copied from the [flate] package, so that code that imports -- cgit v1.3.1-10-gc9f91