Skip to content

Commit

Permalink
chore:lint fix and rebase with master
Browse files Browse the repository at this point in the history
  • Loading branch information
Max-Cheng committed Feb 12, 2024
1 parent 9bdacba commit 3161528
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,6 @@ func (h *fsHandler) handleRequest(ctx *RequestCtx) {
mustCompress = true
fileCacheKind = zstdCacheKind
fileEncoding = "zstd"

}
}

Expand Down
2 changes: 1 addition & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,7 @@ func (resp *Response) zstdBody(level int) error {
wf: zw,
bw: sw,
}
copyZeroAlloc(fw, bs)
copyZeroAlloc(fw, bs) //nolint:errcheck
releaseStacklessZstdWriter(zw, level)
if bsc, ok := bs.(io.Closer); ok {
bsc.Close()
Expand Down
8 changes: 4 additions & 4 deletions zstd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package fasthttp
import (
"bytes"
"fmt"
"io"
"sync"

"github.com/klauspost/compress/zstd"
"github.com/valyala/bytebufferpool"
"github.com/valyala/fasthttp/stackless"
"io"
"sync"
)

const (
Expand Down Expand Up @@ -51,7 +52,7 @@ func acquireZstdWriter(w io.Writer, level int) (*zstd.Encoder, error) {
return zw, nil
}

func releaseZstdWriter(zw *zstd.Encoder) {
func releaseZstdWriter(zw *zstd.Encoder) { //nolint:unused
zw.Close()
zstdEncoderPool.Put(zw)
}
Expand All @@ -68,7 +69,6 @@ func acquireStacklessZstdWriter(w io.Writer, compressLevel int) stackless.Writer
sw := v.(stackless.Writer)
sw.Reset(w)
return sw

}

func releaseStacklessZstdWriter(zf stackless.Writer, zstdDefault int) {
Expand Down

0 comments on commit 3161528

Please sign in to comment.