Skip to content

Commit d6a8de5

Browse files
guyinyouguyinyou
andauthored
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.gyy@alibaba-inc.com>
1 parent 784cd7c commit d6a8de5

2 files changed

Lines changed: 16 additions & 20 deletions

File tree

golang/pkg/utils/utils.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,6 @@ func AutoDecode(in []byte) ([]byte, error) {
181181
return ZlibDecode(in)
182182
case GZIP:
183183
return GZIPDecode(in)
184-
case LZ4:
185-
return Lz4Decode(in)
186-
case ZSTD:
187-
return ZstdDecode(in)
188184
}
189185
return in, fmt.Errorf("unknown format")
190186
}

golang/pkg/utils/utils_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,22 +137,22 @@ func TestAutoDecode(t *testing.T) {
137137
if string(bytes) != "rocketmq-client-go" {
138138
t.Error()
139139
}
140-
// lz4
141-
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})
142-
if err != nil {
143-
t.Error()
144-
}
145-
if string(bytes) != "rocketmq-client-go" {
146-
t.Error()
147-
}
148-
// zstd
149-
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})
150-
if err != nil {
151-
t.Error()
152-
}
153-
if string(bytes) != "rocketmq-client-go" {
154-
t.Error()
155-
}
140+
// // lz4
141+
// 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})
142+
// if err != nil {
143+
// t.Error()
144+
// }
145+
// if string(bytes) != "rocketmq-client-go" {
146+
// t.Error()
147+
// }
148+
// // zstd
149+
// 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})
150+
// if err != nil {
151+
// t.Error()
152+
// }
153+
// if string(bytes) != "rocketmq-client-go" {
154+
// t.Error()
155+
// }
156156
}
157157

158158
func TestGZIPDecode(t *testing.T) {

0 commit comments

Comments
 (0)