From 7a331e10e5d0d1278c91f55754c6cb8acfe0cb04 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sat, 22 Apr 2023 02:42:45 -0700 Subject: [PATCH] zstd: correctly ignore WithEncoderPadding(1) (#806) --- 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) ")