From 343c07731cd9ef77a6cae98fac82d0c6e6ad98ea Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Apr 2023 16:02:48 -0700 Subject: [PATCH] zstd: correctly ignore WithEncoderPadding(1) --- zstd/encoder_options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zstd/encoder_options.go b/zstd/encoder_options.go index 50f70533b4..faaf81921c 100644 --- a/zstd/encoder_options.go +++ b/zstd/encoder_options.go @@ -129,7 +129,7 @@ func WithEncoderPadding(n int) EOption { } // No need to waste our time. if n == 1 { - o.pad = 0 + n = 0 } if n > 1<<30 { return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ")