This is an automated email from the ASF dual-hosted git repository. jinrongtong pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git
The following commit(s) were added to refs/heads/master by this push: new d6a8de5d golang: Remove support for lz4 and zstd compression algorithms (#963) d6a8de5d is described below commit d6a8de5d0ab2aeae0297495f4d5933de4e41b960 Author: guyinyou <36399867+guyin...@users.noreply.github.com> AuthorDate: Wed Mar 19 17:02:14 2025 +0800 golang: Remove support for lz4 and zstd compression algorithms (#963) * Remove support for lz4 and zstd compression algorithms * Remove support for lz4 and zstd compression algorithms --------- Co-authored-by: guyinyou <guyinyou....@alibaba-inc.com> --- golang/pkg/utils/utils.go | 4 ---- golang/pkg/utils/utils_test.go | 32 ++++++++++++++++---------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/golang/pkg/utils/utils.go b/golang/pkg/utils/utils.go index 3af86c63..2fb1fdc1 100644 --- a/golang/pkg/utils/utils.go +++ b/golang/pkg/utils/utils.go @@ -181,10 +181,6 @@ func AutoDecode(in []byte) ([]byte, error) { return ZlibDecode(in) case GZIP: return GZIPDecode(in) - case LZ4: - return Lz4Decode(in) - case ZSTD: - return ZstdDecode(in) } return in, fmt.Errorf("unknown format") } diff --git a/golang/pkg/utils/utils_test.go b/golang/pkg/utils/utils_test.go index 60d6a36d..e8a53fa7 100644 --- a/golang/pkg/utils/utils_test.go +++ b/golang/pkg/utils/utils_test.go @@ -137,22 +137,22 @@ func TestAutoDecode(t *testing.T) { if string(bytes) != "rocketmq-client-go" { t.Error() } - // lz4 - bytes, err = AutoDecode([]byte{4, 34, 77, 24, 100, 112, 185, 18, 0, 0, 128, 114, 111, 99, 107, 101, 116, 109, 113, 45, 99, 108, 105, 101, 110, 116, 45, 103, 111, 0, 0, 0, 0, 248, 183, 23, 47}) - if err != nil { - t.Error() - } - if string(bytes) != "rocketmq-client-go" { - t.Error() - } - // zstd - bytes, err = AutoDecode([]byte{40, 181, 47, 253, 32, 18, 145, 0, 0, 114, 111, 99, 107, 101, 116, 109, 113, 45, 99, 108, 105, 101, 110, 116, 45, 103, 111}) - if err != nil { - t.Error() - } - if string(bytes) != "rocketmq-client-go" { - t.Error() - } + // // lz4 + // bytes, err = AutoDecode([]byte{4, 34, 77, 24, 100, 112, 185, 18, 0, 0, 128, 114, 111, 99, 107, 101, 116, 109, 113, 45, 99, 108, 105, 101, 110, 116, 45, 103, 111, 0, 0, 0, 0, 248, 183, 23, 47}) + // if err != nil { + // t.Error() + // } + // if string(bytes) != "rocketmq-client-go" { + // t.Error() + // } + // // zstd + // bytes, err = AutoDecode([]byte{40, 181, 47, 253, 32, 18, 145, 0, 0, 114, 111, 99, 107, 101, 116, 109, 113, 45, 99, 108, 105, 101, 110, 116, 45, 103, 111}) + // if err != nil { + // t.Error() + // } + // if string(bytes) != "rocketmq-client-go" { + // t.Error() + // } } func TestGZIPDecode(t *testing.T) {