aboutsummaryrefslogtreecommitdiff
path: root/http.go
diff options
context:
space:
mode:
authorGravatar Oleksandr Redko <oleksandr.red+github@gmail.com> 2024-03-02 17:19:05 +0200
committerGravatar GitHub <noreply@github.com> 2024-03-02 16:19:05 +0100
commit3166afd835a00486c918f1d3149696855897c923 (patch)
tree9ba64d0f8f16688512cf83a77787f70b0f56b81c /http.go
parentchore(deps): bump golang.org/x/crypto from 0.19.0 to 0.20.0 (#1725) (diff)
downloadfasthttp-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.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/http.go b/http.go
index e078809..f54a183 100644
--- a/http.go
+++ b/http.go
@@ -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