From 41e4eb63c43880f2232b2b5e8e743f715af8b76c Mon Sep 17 00:00:00 2001 From: Max-Cheng Date: Thu, 8 Feb 2024 21:36:53 +0800 Subject: [PATCH] fix:error default compress level --- zstd.go | 3 ++- zstd_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/zstd.go b/zstd.go index a54d2569b4..15ab2463d0 100644 --- a/zstd.go +++ b/zstd.go @@ -8,6 +8,7 @@ import ( "github.com/klauspost/compress/zstd" "github.com/valyala/bytebufferpool" + "github.com/valyala/fasthttp/stackless" ) @@ -149,7 +150,7 @@ func nonblockingWriteZstd(ctxv any) { // AppendZstdBytes appends zstd src to dst and returns the resulting dst. func AppendZstdBytes(dst, src []byte) []byte { - return AppendZstdBytesLevel(dst, src, CompressBrotliDefaultCompression) + return AppendZstdBytesLevel(dst, src, CompressZstdDefault) } // WriteUnzstd writes unzstd p to w and returns the number of uncompressed diff --git a/zstd_test.go b/zstd_test.go index dc0c45f339..620ef7d708 100644 --- a/zstd_test.go +++ b/zstd_test.go @@ -38,7 +38,7 @@ func testZstdBytesSingleCase(s string) error { if !bytes.Equal(ZstdpedS[:len(prefix)], prefix) { return fmt.Errorf("unexpected prefix when compressing %q: %q. Expecting %q", s, ZstdpedS[:len(prefix)], prefix) } - + unZstdedS, err := AppendUnzstdBytes(prefix, ZstdpedS[len(prefix):]) if err != nil { return fmt.Errorf("unexpected error when uncompressing %q: %w", s, err)