From e4529364ef6c1bce91eee5a21dcb170266400fc4 Mon Sep 17 00:00:00 2001 From: Lukas Malkmus Date: Mon, 15 Nov 2021 17:26:50 +0100 Subject: [PATCH] Drop deadcode --- proxy/proxy.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index 86a6682..ad368e6 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -37,15 +37,6 @@ func init() { } } -type zstdCloser struct { - *zstd.Decoder -} - -func (zc *zstdCloser) Close() error { - zc.Decoder.Close() - return nil -} - func Decompress(rdr io.ReadCloser, encoding string) (io.ReadCloser, error) { switch encoding { case "gzip": @@ -53,15 +44,13 @@ func Decompress(rdr io.ReadCloser, encoding string) (io.ReadCloser, error) { if err != nil { return nil, err } - defer decomp.Close() return decomp, nil case "zstd": decomp, err := zstd.NewReader(rdr) if err != nil { return nil, err } - // else we leak - return &zstdCloser{Decoder: decomp}, nil + return decomp.IOReadCloser(), nil default: return rdr, nil }