From dc8d944d2e8c64b66b42820b94d6d88c9976d5cd Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Sun, 15 Sep 2024 08:19:54 -0400 Subject: [PATCH 1/2] Bump golangci-lint to v1.61.0 --- .github/workflows/linter.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 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 From fac048d992431f07c57b6a29252e15878544f0ee Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sun, 15 Sep 2024 13:14:27 -0400 Subject: [PATCH 2/2] Fix golangci warnings --- middleware/cache/cache.go | 4 ++-- middleware/etag/etag.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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('"')