From 0ef8d716eef802143cfc3cbaefa9fd71b4a03589 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Sun, 15 Sep 2024 13:28:22 -0400 Subject: [PATCH] Bump golangci-lint to v1.61.0 (#3135) * Bump golangci-lint to v1.61.0 * Fix golangci warnings --- .github/workflows/linter.yml | 2 +- Makefile | 2 +- middleware/cache/cache.go | 4 ++-- middleware/etag/etag.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 6c378e4043..dc04fec67b 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -37,4 +37,4 @@ jobs: uses: golangci/golangci-lint-action@v6 with: # NOTE: Keep this in sync with the version from .golangci.yml - version: v1.60.3 + version: v1.61.0 diff --git a/Makefile b/Makefile index 1d7f57d03c..33526991a3 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ markdown: ## lint: 🚨 Run lint checks .PHONY: lint lint: - go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3 run ./... + go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 run ./... ## test: 🚦 Execute all tests .PHONY: test diff --git a/middleware/cache/cache.go b/middleware/cache/cache.go index 69c3fd5c1d..f593b56e4e 100644 --- a/middleware/cache/cache.go +++ b/middleware/cache/cache.go @@ -63,7 +63,7 @@ func New(config ...Config) fiber.Handler { var ( // Cache settings mux = &sync.RWMutex{} - timestamp = uint64(time.Now().Unix()) + timestamp = uint64(time.Now().Unix()) //nolint:gosec //Not a concern ) // Create manager to simplify storage operations ( see manager.go ) manager := newManager(cfg.Storage) @@ -75,7 +75,7 @@ func New(config ...Config) fiber.Handler { // Update timestamp in the configured interval go func() { for { - atomic.StoreUint64(×tamp, uint64(time.Now().Unix())) + atomic.StoreUint64(×tamp, uint64(time.Now().Unix())) //nolint:gosec //Not a concern time.Sleep(timestampUpdatePeriod) } }() diff --git a/middleware/etag/etag.go b/middleware/etag/etag.go index aca57bc1e7..f28a33cec5 100644 --- a/middleware/etag/etag.go +++ b/middleware/etag/etag.go @@ -65,7 +65,7 @@ func New(config ...Config) fiber.Handler { return c.SendStatus(fiber.StatusRequestEntityTooLarge) } - bb.B = appendUint(bb.Bytes(), uint32(bodyLength)) //nolint:gosec // Body length is validated above + bb.B = appendUint(bb.Bytes(), uint32(bodyLength)) bb.WriteByte('-') bb.B = appendUint(bb.Bytes(), crc32.Checksum(body, crc32q)) bb.WriteByte('"')