diff options
author | Oleksandr Redko <oleksandr.red+github@gmail.com> | 2024-03-02 17:19:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-02 16:19:05 +0100 |
commit | 3166afd835a00486c918f1d3149696855897c923 (patch) | |
tree | 9ba64d0f8f16688512cf83a77787f70b0f56b81c /http.go | |
parent | chore(deps): bump golang.org/x/crypto from 0.19.0 to 0.20.0 (#1725) (diff) | |
download | fasthttp-3166afd835a00486c918f1d3149696855897c923.tar.gz fasthttp-3166afd835a00486c918f1d3149696855897c923.tar.bz2 fasthttp-3166afd835a00486c918f1d3149696855897c923.zip |
Enable few gocritic checks; fix up issues (#1728)
Diffstat (limited to 'http.go')
-rw-r--r-- | http.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1201,7 +1201,7 @@ func (req *Request) ReadLimitBody(r *bufio.Reader, maxBodySize int) error { return req.readLimitBody(r, maxBodySize, false, true) } -func (req *Request) readLimitBody(r *bufio.Reader, maxBodySize int, getOnly bool, preParseMultipartForm bool) error { +func (req *Request) readLimitBody(r *bufio.Reader, maxBodySize int, getOnly, preParseMultipartForm bool) error { // Do not reset the request here - the caller must reset it before // calling this method. @@ -1219,7 +1219,7 @@ func (req *Request) readLimitBody(r *bufio.Reader, maxBodySize int, getOnly bool return req.ContinueReadBody(r, maxBodySize, preParseMultipartForm) } -func (req *Request) readBodyStream(r *bufio.Reader, maxBodySize int, getOnly bool, preParseMultipartForm bool) error { +func (req *Request) readBodyStream(r *bufio.Reader, maxBodySize int, getOnly, preParseMultipartForm bool) error { // Do not reset the request here - the caller must reset it before // calling this method. @@ -1310,7 +1310,7 @@ func (req *Request) ContinueReadBody(r *bufio.Reader, maxBodySize int, preParseM // // If maxBodySize > 0 and the body size exceeds maxBodySize, // then ErrBodyTooLarge is returned. -func (req *Request) ReadBody(r *bufio.Reader, contentLength int, maxBodySize int) (err error) { +func (req *Request) ReadBody(r *bufio.Reader, contentLength, maxBodySize int) (err error) { bodyBuf := req.bodyBuffer() bodyBuf.Reset() @@ -2242,7 +2242,7 @@ func writeChunk(w *bufio.Writer, b []byte) error { // the given limit. var ErrBodyTooLarge = errors.New("body size exceeds the given limit") -func readBody(r *bufio.Reader, contentLength int, maxBodySize int, dst []byte) ([]byte, error) { +func readBody(r *bufio.Reader, contentLength, maxBodySize int, dst []byte) ([]byte, error) { if maxBodySize > 0 && contentLength > maxBodySize { return dst, ErrBodyTooLarge } @@ -2251,7 +2251,7 @@ func readBody(r *bufio.Reader, contentLength int, maxBodySize int, dst []byte) ( var errChunkedStream = errors.New("chunked stream") -func readBodyWithStreaming(r *bufio.Reader, contentLength int, maxBodySize int, dst []byte) (b []byte, err error) { +func readBodyWithStreaming(r *bufio.Reader, contentLength, maxBodySize int, dst []byte) (b []byte, err error) { if contentLength == -1 { // handled in requestStream.Read() return b, errChunkedStream |