Skip to content

Commit fcf5a97

Browse files
authored
Chore: update dependencies (#498)
* Update dependencies * Update linter and fix linting issues * Remove go 1.21 from unit tests and add 1.23
1 parent 3772045 commit fcf5a97

12 files changed

+90
-77
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
go-version: ["1.21", "1.22", stable]
38+
go-version: ["1.22", "1.23", stable]
3939
steps:
4040
- name: Checkout Repository
4141
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -90,7 +90,7 @@ jobs:
9090
run: docker compose up test-no-stream --exit-code-from test-no-stream
9191

9292
- name: Create/Update Draft
93-
uses: lucacome/draft-release@5d29432a46bff6c122cd4b07a1fb94e1bb158d34 # v1.1.1
93+
uses: lucacome/draft-release@f15262dc3ac8c3efbf09a8ce5406cd0fc47aabb1 # v1.2.2
9494
id: release-notes
9595
with:
9696
minor-label: "enhancement"
@@ -106,7 +106,7 @@ jobs:
106106
if: ${{ github.ref_type == 'tag' }}
107107

108108
- name: Run GoReleaser
109-
uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6.2.1
109+
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
110110
with:
111111
version: v2.7.0 # renovate: datasource=github-tags depName=goreleaser/goreleaser
112112
args: release --clean

.github/workflows/codeql-analysis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858

5959
# Initializes the CodeQL tools for scanning.
6060
- name: Initialize CodeQL
61-
uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
61+
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
6262
with:
6363
languages: ${{ matrix.language }}
6464
build-mode: ${{ matrix.build-mode }}
@@ -70,6 +70,6 @@ jobs:
7070
# queries: security-extended,security-and-quality
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
73+
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
7474
with:
7575
category: "/language:${{matrix.language}}"

.github/workflows/lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
go-version: stable
3434

3535
- name: Lint Go
36-
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
36+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
3737
with:
38-
version: v1.64.8 # renovate: datasource=github-tags depName=golangci/golangci-lint
38+
version: v2.1.5 # renovate: datasource=github-tags depName=golangci/golangci-lint
3939

4040
actionlint:
4141
name: Actionlint
@@ -45,7 +45,7 @@ jobs:
4545
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4646

4747
- name: Lint Actions
48-
uses: reviewdog/action-actionlint@db58217885f9a6570da9c71be4e40ec33fe44a1f # v1.65.0
48+
uses: reviewdog/action-actionlint@a5524e1c19e62881d79c1f1b9b6f09f16356e281 # v1.65.2
4949
with:
5050
actionlint_flags: -shellcheck ""
5151

.github/workflows/scorecard.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ jobs:
5757

5858
# Upload the results to GitHub's code scanning dashboard.
5959
- name: "Upload to code-scanning"
60-
uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10
60+
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
6161
with:
6262
sarif_file: results.sarif

.golangci.yml

+64-51
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,6 @@
1-
linters-settings:
2-
misspell:
3-
locale: US
4-
revive:
5-
ignore-generated-header: true
6-
rules:
7-
- name: blank-imports
8-
- name: constant-logical-expr
9-
- name: context-as-argument
10-
- name: context-keys-type
11-
- name: defer
12-
- name: dot-imports
13-
- name: duplicated-imports
14-
- name: empty-block
15-
- name: error-naming
16-
- name: error-return
17-
- name: error-strings
18-
- name: errorf
19-
- name: exported
20-
- name: import-shadowing
21-
- name: increment-decrement
22-
- name: indent-error-flow
23-
- name: package-comments
24-
- name: range
25-
- name: range-val-address
26-
- name: range-val-in-closure
27-
- name: receiver-naming
28-
- name: redefines-builtin-id
29-
- name: string-of-int
30-
- name: superfluous-else
31-
- name: time-naming
32-
- name: unchecked-type-assertion
33-
- name: unexported-return
34-
- name: unnecessary-stmt
35-
- name: unreachable-code
36-
- name: unused-parameter
37-
- name: var-declaration
38-
- name: var-naming
39-
govet:
40-
enable-all: true
1+
version: "2"
412
linters:
3+
default: none
424
enable:
435
- asasalint
446
- asciicheck
@@ -59,11 +21,7 @@ linters:
5921
- gochecksumtype
6022
- gocritic
6123
- godot
62-
- gofmt
63-
- gofumpt
64-
- goimports
6524
- gosec
66-
- gosimple
6725
- gosmopolitan
6826
- govet
6927
- ineffassign
@@ -75,29 +33,84 @@ linters:
7533
- nilerr
7634
- noctx
7735
- nolintlint
36+
- paralleltest
7837
- perfsprint
7938
- prealloc
8039
- predeclared
81-
- paralleltest
8240
- reassign
8341
- revive
8442
- staticcheck
85-
- stylecheck
8643
- tagalign
87-
- tenv
8844
- thelper
8945
- tparallel
90-
- typecheck
9146
- unconvert
9247
- unparam
9348
- unused
9449
- usestdlibvars
9550
- wastedassign
9651
- whitespace
9752
- wrapcheck
98-
disable-all: true
53+
settings:
54+
govet:
55+
enable-all: true
56+
misspell:
57+
locale: US
58+
revive:
59+
rules:
60+
- name: blank-imports
61+
- name: constant-logical-expr
62+
- name: context-as-argument
63+
- name: context-keys-type
64+
- name: defer
65+
- name: dot-imports
66+
- name: duplicated-imports
67+
- name: empty-block
68+
- name: error-naming
69+
- name: error-return
70+
- name: error-strings
71+
- name: errorf
72+
- name: exported
73+
- name: import-shadowing
74+
- name: increment-decrement
75+
- name: indent-error-flow
76+
- name: package-comments
77+
- name: range
78+
- name: range-val-address
79+
- name: range-val-in-closure
80+
- name: receiver-naming
81+
- name: redefines-builtin-id
82+
- name: string-of-int
83+
- name: superfluous-else
84+
- name: time-naming
85+
- name: unchecked-type-assertion
86+
- name: unexported-return
87+
- name: unnecessary-stmt
88+
- name: unreachable-code
89+
- name: unused-parameter
90+
- name: var-declaration
91+
- name: var-naming
92+
exclusions:
93+
generated: lax
94+
presets:
95+
- comments
96+
- common-false-positives
97+
- legacy
98+
- std-error-handling
99+
paths:
100+
- third_party$
101+
- builtin$
102+
- examples$
99103
issues:
100104
max-issues-per-linter: 0
101105
max-same-issues: 0
102-
run:
103-
timeout: 5m
106+
formatters:
107+
enable:
108+
- gofmt
109+
- gofumpt
110+
- goimports
111+
exclusions:
112+
generated: lax
113+
paths:
114+
- third_party$
115+
- builtin$
116+
- examples$

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ repos:
2424
- id: detect-private-key
2525

2626
- repo: https://github.com/golangci/golangci-lint
27-
rev: v1.64.8
27+
rev: v2.0.2
2828
hooks:
2929
- id: golangci-lint-full
3030

3131
- repo: https://github.com/gitleaks/gitleaks
32-
rev: v8.24.0
32+
rev: v8.24.3
3333
hooks:
3434
- id: gitleaks
3535

@@ -39,7 +39,7 @@ repos:
3939
- id: markdownlint-cli2
4040

4141
- repo: https://github.com/adrienverge/yamllint.git
42-
rev: v1.35.1
42+
rev: v1.37.0
4343
hooks:
4444
- id: yamllint
4545

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# renovate: datasource=github-tags depName=golangci/golangci-lint
2-
GOLANGCI_LINT_VERSION = v1.64.8
2+
GOLANGCI_LINT_VERSION = v2.1.5
33

44
test: unit-test test-integration test-integration-no-stream-block clean
55

66
lint:
7-
go run github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --fix
7+
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) run --fix
88

99
unit-test:
1010
go test -v -shuffle=on -race client/*.go

client/nginx_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -677,8 +677,8 @@ func TestClientWithMaxAPI(t *testing.T) {
677677
t.Parallel()
678678
// Test creating a new client with max API version
679679
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
680-
switch {
681-
case r.RequestURI == "/":
680+
switch r.RequestURI {
681+
case "/":
682682
_, err := w.Write([]byte(tt.apiVersions))
683683
if err != nil {
684684
t.Fatalf("unexpected error: %v", err)
@@ -852,8 +852,8 @@ func TestGetStats_SSL(t *testing.T) {
852852
func TestGetMaxAPIVersionServer(t *testing.T) {
853853
t.Parallel()
854854
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
855-
switch {
856-
case r.RequestURI == "/":
855+
switch r.RequestURI {
856+
case "/":
857857
_, err := w.Write([]byte(`[4, 5, 6, 7]`))
858858
if err != nil {
859859
t.Fatalf("unexpected error: %v", err)
@@ -884,8 +884,8 @@ func TestGetMaxAPIVersionServer(t *testing.T) {
884884
func TestGetMaxAPIVersionClient(t *testing.T) {
885885
t.Parallel()
886886
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
887-
switch {
888-
case r.RequestURI == "/":
887+
switch r.RequestURI {
888+
case "/":
889889
_, err := w.Write([]byte(`[4, 5, 6, 7, 8, 9, 25]`))
890890
if err != nil {
891891
t.Fatalf("unexpected error: %v", err)

compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
service: nginx
3030

3131
test:
32-
image: golang:1.23
32+
image: golang:1.24
3333
volumes:
3434
- type: bind
3535
source: ./

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# syntax=docker/dockerfile:1.14
1+
# syntax=docker/dockerfile:1.15
22
FROM debian:12-slim
33

44
LABEL maintainer="NGINX Docker Maintainers <[email protected]>"

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module github.com/nginx/nginx-plus-go-client/v2
22

3-
go 1.22.6
3+
go 1.24.2
44

5-
require golang.org/x/sync v0.11.0
5+
require golang.org/x/sync v0.13.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
2-
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
1+
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
2+
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=

0 commit comments

Comments
 (0)