From 10b7b78e63713bd18fdb14c9677c13d2d118325a Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez Date: Sat, 17 Aug 2024 10:02:50 -0400 Subject: [PATCH 1/3] Add support for go1.23 and golanci-lint v1.60.1 --- .github/workflows/benchmark.yml | 2 +- .github/workflows/linter.yml | 4 ++-- .github/workflows/test.yml | 6 +++--- Makefile | 2 +- README.md | 2 +- convert_test.go | 2 +- go.mod | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e162c0c..7b77432 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -26,7 +26,7 @@ jobs: uses: actions/setup-go@v5 with: # NOTE: Keep this in sync with the version from go.mod - go-version: "1.21.x" + go-version: "1.22.x" - name: Run Benchmark run: set -o pipefail; go test ./... -benchmem -run=^$ -bench . | tee output.txt diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 58e2217..148541c 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -33,11 +33,11 @@ jobs: - uses: actions/setup-go@v5 with: # NOTE: Keep this in sync with the version from go.mod - go-version: "1.21.x" + go-version: "1.22.x" cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: # NOTE: Keep this in sync with the version from .golangci.yml - version: v1.59.1 \ No newline at end of file + version: v1.60.1 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6892ab6..798890d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,8 +18,8 @@ jobs: Build: strategy: matrix: - go-version: [1.21.x, 1.22.x] - platform: [ubuntu-latest, windows-latest, macos-latest, macos-14] + go-version: [1.22.x, 1.23.x] + platform: [ubuntu-latest, windows-latest, macos-latest, macos-13] runs-on: ${{ matrix.platform }} steps: - name: Fetch Repository @@ -40,7 +40,7 @@ jobs: run: gotestsum -f testname -- ./... -race -count=1 -coverprofile=coverage.txt -covermode=atomic -shuffle=on - name: Upload coverage reports to Codecov - if: ${{ matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.22.x' }} + if: ${{ matrix.platform == 'ubuntu-latest' && matrix.go-version == '1.23.x' }} uses: codecov/codecov-action@v4.5.0 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/Makefile b/Makefile index 4626a38..301c133 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ format: ## lint: 🚨 Run lint checks .PHONY: lint lint: - go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1 run ./... + go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1 run ./... ## test: 🚦 Execute all tests .PHONY: test diff --git a/README.md b/README.md index d2c24da..8e134a7 100644 --- a/README.md +++ b/README.md @@ -137,4 +137,4 @@ Benchmark_CalculateTimestamp/default-12 15789036 71.12 ns/op ``` -See all the benchmarks under https://gofiber.github.io/utils/ \ No newline at end of file +See all the benchmarks under diff --git a/convert_test.go b/convert_test.go index c1db239..087d816 100644 --- a/convert_test.go +++ b/convert_test.go @@ -191,7 +191,7 @@ func TestCopyBytes(t *testing.T) { t.Run("nil slice", func(t *testing.T) { copied := CopyBytes(nil) require.NotNil(t, copied) - require.Empty(t, len(copied)) + require.Empty(t, copied) require.Equal(t, 0, cap(copied)) }) } diff --git a/go.mod b/go.mod index 237aa95..8e34abd 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/gofiber/utils/v2 -go 1.21 +go 1.22 require ( github.com/google/uuid v1.6.0 From 7cb7ce6542d87ead029c69b598f842190e3b0596 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Tue, 8 Oct 2024 08:11:41 -0400 Subject: [PATCH 2/3] 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 148541c..7e17d8f 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -40,4 +40,4 @@ jobs: uses: golangci/golangci-lint-action@v6 with: # NOTE: Keep this in sync with the version from .golangci.yml - version: v1.60.1 \ No newline at end of file + version: v1.61.0 \ No newline at end of file diff --git a/Makefile b/Makefile index 301c133..efd715d 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ format: ## lint: 🚨 Run lint checks .PHONY: lint lint: - go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1 run ./... + go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 run ./... ## test: 🚦 Execute all tests .PHONY: test From 9a549517e604199fc5ba16ac95489e410becf316 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Tue, 8 Oct 2024 08:14:00 -0400 Subject: [PATCH 3/3] Update golangci-lint config --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 078e097..e2dcb29 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -95,6 +95,7 @@ linters-settings: gosec: excludes: - G104 # TODO: Enable this again. Mostly provided by errcheck + - G115 config: global: # show-ignored: true # TODO: Enable this @@ -289,7 +290,6 @@ linters: - exhaustive # - exhaustivestruct # - exhaustruct - - exportloopref - forbidigo - forcetypeassert # - funlen