Skip to content

Commit 63e8b07

Browse files
authored
fix: Make it possible to override decompressor for existing method (#302)
make possible to override decompressor for existed method
1 parent 695062b commit 63e8b07

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

register.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ func init() {
7575

7676
// RegisterDecompressor allows custom decompressors for a specified method ID.
7777
func RegisterDecompressor(method []byte, dcomp Decompressor) {
78-
if _, dup := decompressors.LoadOrStore(string(method), dcomp); dup {
79-
panic("decompressor already registered")
80-
}
78+
decompressors.Store(string(method), dcomp)
8179
}
8280

8381
func decompressor(method []byte) Decompressor {

0 commit comments

Comments
 (0)