From c98df8e7993c96f5e0cb91c3b13092e56fa06cd1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 21:33:35 +0000 Subject: [PATCH 1/2] chore(deps): update dependency golangci/golangci-lint to v1.60.2 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1f809f61..ca59bfb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ ENV GOPATH="/var/tmp/go" RUN set -x \ # renovate: source=github-releases name=golangci/golangci-lint - && GOLANGCI_LINT_VERSION="1.60.1" \ + && GOLANGCI_LINT_VERSION="1.60.2" \ && wget -O- -nv "https://cdn.jsdelivr.net/gh/golangci/golangci-lint@v${GOLANGCI_LINT_VERSION}/install.sh" \ | sh -s -- -b /bin "v${GOLANGCI_LINT_VERSION}" From 7ba67d45332cc5853c40399b9710950ffd9cd5af Mon Sep 17 00:00:00 2001 From: Paramtamtam <7326800+tarampampam@users.noreply.github.com> Date: Wed, 21 Aug 2024 12:29:07 +0400 Subject: [PATCH 2/2] linter fixes --- .golangci.yml | 2 +- internal/cli/build/command.go | 4 ++-- internal/cli/perftest/command.go | 6 +++--- internal/cli/serve/command.go | 4 ++-- internal/cli/serve/command_test.go | 2 +- internal/http/handlers/error_page/code.go | 4 ++-- internal/http/server.go | 2 +- internal/http/server_test.go | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 80ed7613..069a034a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -61,7 +61,7 @@ linters: # All available linters list: 0 && code < 999 { - return uint16(code), true + return uint16(code), true //nolint:gosec } return 0, false @@ -47,7 +47,7 @@ func extractCodeFromHeaders(headers *fasthttp.RequestHeader) (uint16, bool) { // HTTP status code returned by the request if value := headers.Peek("X-Code"); len(value) > 0 && len(value) <= 3 { if code, err := strconv.ParseUint(string(value), 10, 16); err == nil && code > 0 && code < 999 { - return uint16(code), true + return uint16(code), true //nolint:gosec } } diff --git a/internal/http/server.go b/internal/http/server.go index 7edc6147..13442e49 100644 --- a/internal/http/server.go +++ b/internal/http/server.go @@ -40,7 +40,7 @@ func NewServer(log *logger.Logger, readBufferSize uint) Server { server: &fasthttp.Server{ ReadTimeout: readTimeout, WriteTimeout: writeTimeout, - ReadBufferSize: int(readBufferSize), + ReadBufferSize: int(readBufferSize), //nolint:gosec DisablePreParseMultipartForm: true, NoDefaultServerHeader: true, CloseOnShutdown: true, diff --git a/internal/http/server_test.go b/internal/http/server_test.go index 1ca8dad0..acfe6499 100644 --- a/internal/http/server_test.go +++ b/internal/http/server_test.go @@ -392,5 +392,5 @@ func getFreeTcpPort(t *testing.T) uint16 { <-time.After(5 * time.Millisecond) } - return uint16(port) + return uint16(port) //nolint:gosec }