diff options
Diffstat (limited to 'compress.go')
-rw-r--r-- | compress.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compress.go b/compress.go index 1f44f1e..895dc51 100644 --- a/compress.go +++ b/compress.go @@ -179,17 +179,17 @@ func WriteGzipLevel(w io.Writer, p []byte, level int) (int, error) { var ( stacklessWriteGzipOnce sync.Once - stacklessWriteGzipFunc func(ctx interface{}) bool + stacklessWriteGzipFunc func(ctx any) bool ) -func stacklessWriteGzip(ctx interface{}) { +func stacklessWriteGzip(ctx any) { stacklessWriteGzipOnce.Do(func() { stacklessWriteGzipFunc = stackless.NewFunc(nonblockingWriteGzip) }) stacklessWriteGzipFunc(ctx) } -func nonblockingWriteGzip(ctxv interface{}) { +func nonblockingWriteGzip(ctxv any) { ctx := ctxv.(*compressCtx) zw := acquireRealGzipWriter(ctx.w, ctx.level) @@ -282,17 +282,17 @@ func WriteDeflateLevel(w io.Writer, p []byte, level int) (int, error) { var ( stacklessWriteDeflateOnce sync.Once - stacklessWriteDeflateFunc func(ctx interface{}) bool + stacklessWriteDeflateFunc func(ctx any) bool ) -func stacklessWriteDeflate(ctx interface{}) { +func stacklessWriteDeflate(ctx any) { stacklessWriteDeflateOnce.Do(func() { stacklessWriteDeflateFunc = stackless.NewFunc(nonblockingWriteDeflate) }) stacklessWriteDeflateFunc(ctx) } -func nonblockingWriteDeflate(ctxv interface{}) { +func nonblockingWriteDeflate(ctxv any) { ctx := ctxv.(*compressCtx) zw := acquireRealDeflateWriter(ctx.w, ctx.level) |