Skip to content

Commit 1147824

Browse files
authored
go1.23 support (golangci#4836)
1 parent 9eeb891 commit 1147824

15 files changed

+68
-147
lines changed

.github/workflows/documentation.yml

+10-26
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,33 @@ jobs:
1111
name: Build and deploy documentation
1212
runs-on: ubuntu-latest
1313
env:
14-
GO_VERSION: '1.22'
14+
# https://github.com/actions/setup-go#supported-version-syntax
15+
# ex:
16+
# - 1.18beta1 -> 1.18.0-beta.1
17+
# - 1.18rc1 -> 1.18.0-rc.1
18+
GO_VERSION: '1.23'
1519
NODE_VERSION: '20.x'
1620
CGO_ENABLED: 0
17-
1821
steps:
19-
- name: Check out code
20-
uses: actions/checkout@v4
21-
with:
22-
fetch-depth: 0
23-
24-
- name: Set up Go ${{ env.GO_VERSION }}
25-
uses: actions/setup-go@v5
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-go@v5
2624
with:
2725
go-version: ${{ env.GO_VERSION }}
28-
29-
- name: Cache Go modules
30-
uses: actions/cache@v4
31-
with:
32-
# In order:
33-
# * Module download cache
34-
# * Build cache (Linux)
35-
path: |
36-
~/go/pkg/mod
37-
~/.cache/go-build
38-
key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
39-
restore-keys: |
40-
docs-${{ runner.os }}-go-
41-
42-
- run: go mod download
43-
4426
- name: Use Node.js ${{ env.NODE_VERSION }}
4527
uses: actions/setup-node@v4
4628
with:
4729
node-version: ${{ env.NODE_VERSION }}
4830
cache: npm
4931
cache-dependency-path: docs/package-lock.json
5032

33+
- run: go mod download
34+
5135
- run: npm install --legacy-peer-deps
5236
working-directory: ./docs
5337

5438
- name: Build Documentation
55-
run: npm run build
5639
working-directory: ./docs
40+
run: npm run build
5741

5842
- name: Deploy to GitHub Pages
5943
uses: peaceiris/actions-gh-pages@v4

.github/workflows/post-release.yml

+11-22
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ jobs:
1111
runs-on: ubuntu-latest
1212
env:
1313
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
14+
# https://github.com/actions/setup-go#supported-version-syntax
15+
# ex:
16+
# - 1.18beta1 -> 1.18.0-beta.1
17+
# - 1.18rc1 -> 1.18.0-rc.1
18+
GO_VERSION: '1.23'
1419
steps:
1520
- uses: actions/checkout@v4
16-
- name: Install Go
17-
uses: actions/setup-go@v5
21+
- uses: actions/setup-go@v5
1822
with:
19-
# https://github.com/actions/setup-go#supported-version-syntax
20-
# ex:
21-
# - 1.18beta1 -> 1.18.0-beta.1
22-
# - 1.18rc1 -> 1.18.0-rc.1
23-
go-version: '1.22'
23+
go-version: ${{ env.GO_VERSION }}
2424
- uses: actions/setup-node@v4
2525
with:
2626
node-version: "15"
@@ -49,14 +49,9 @@ jobs:
4949
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
5050
steps:
5151
- uses: actions/checkout@v4
52-
- name: Install Go
53-
uses: actions/setup-go@v5
52+
- uses: actions/setup-go@v5
5453
with:
55-
# https://github.com/actions/setup-go#supported-version-syntax
56-
# ex:
57-
# - 1.18beta1 -> 1.18.0-beta.1
58-
# - 1.18rc1 -> 1.18.0-rc.1
59-
go-version: '1.22'
54+
go-version: ${{ env.GO_VERSION }}
6055

6156
- name: Update GitHub Action config
6257
run: make assets/github-action-config.json
@@ -77,14 +72,9 @@ jobs:
7772
GITHUB_TOKEN: ${{ secrets.GOLANGCI_LINT_TOKEN }}
7873
steps:
7974
- uses: actions/checkout@v4
80-
- name: Install Go
81-
uses: actions/setup-go@v5
75+
- uses: actions/setup-go@v5
8276
with:
83-
# https://github.com/actions/setup-go#supported-version-syntax
84-
# ex:
85-
# - 1.18beta1 -> 1.18.0-beta.1
86-
# - 1.18rc1 -> 1.18.0-rc.1
87-
go-version: '1.22'
77+
go-version: ${{ env.GO_VERSION }}
8878

8979
- name: Update reference files
9080
run: cp .golangci.next.reference.yml .golangci.reference.yml
@@ -110,6 +100,5 @@ jobs:
110100
matrix:
111101
os: [ubuntu-latest, macos-latest, windows-latest]
112102
runs-on: ${{ matrix.os }}
113-
114103
steps:
115104
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "./install-golangci-lint"

.github/workflows/pr-documentation.yml

+9-24
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,28 @@ jobs:
99
name: Build documentation
1010
runs-on: ubuntu-latest
1111
env:
12-
GO_VERSION: '1.22'
12+
# https://github.com/actions/setup-go#supported-version-syntax
13+
# ex:
14+
# - 1.18beta1 -> 1.18.0-beta.1
15+
# - 1.18rc1 -> 1.18.0-rc.1
16+
GO_VERSION: '1.23'
1317
NODE_VERSION: '20.x'
1418
CGO_ENABLED: 0
1519

1620
steps:
17-
- name: Check out code
18-
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
21-
22-
- name: Set up Go ${{ env.GO_VERSION }}
23-
uses: actions/setup-go@v5
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-go@v5
2423
with:
2524
go-version: ${{ env.GO_VERSION }}
26-
27-
- name: Cache Go modules
28-
uses: actions/cache@v4
29-
with:
30-
# In order:
31-
# * Module download cache
32-
# * Build cache (Linux)
33-
path: |
34-
~/go/pkg/mod
35-
~/.cache/go-build
36-
key: docs-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
37-
restore-keys: |
38-
docs-${{ runner.os }}-go-
39-
40-
- run: go mod download
41-
4225
- name: Use Node.js ${{ env.NODE_VERSION }}
4326
uses: actions/setup-node@v4
4427
with:
4528
node-version: ${{ env.NODE_VERSION }}
4629
cache: npm
4730
cache-dependency-path: docs/package-lock.json
4831

32+
- run: go mod download
33+
4934
- run: npm install --legacy-peer-deps
5035
working-directory: ./docs
5136

.github/workflows/pr-extra.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
# ex:
1818
# - 1.18beta1 -> 1.18.0-beta.1
1919
# - 1.18rc1 -> 1.18.0-rc.1
20-
go-version: '1.22'
20+
go-version: '1.23'
2121
- name: Run go list
2222
run: go list -json -m all > go.list
2323
- name: Nancy

.github/workflows/pr.yml

+21-53
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@ on:
66
pull_request:
77

88
env:
9-
GO_VERSION: '1.22'
9+
# https://github.com/actions/setup-go#supported-version-syntax
10+
# ex:
11+
# - 1.18beta1 -> 1.18.0-beta.1
12+
# - 1.18rc1 -> 1.18.0-rc.1
13+
GO_VERSION: '1.23'
1014

1115
jobs:
1216
# Check if there is any dirty change for go mod tidy
1317
go-mod:
1418
runs-on: ubuntu-latest
1519
steps:
16-
- name: Install Go
17-
uses: actions/setup-go@v5
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-go@v5
1822
with:
19-
# https://github.com/actions/setup-go#supported-version-syntax
20-
# ex:
21-
# - 1.18beta1 -> 1.18.0-beta.1
22-
# - 1.18rc1 -> 1.18.0-rc.1
2323
go-version: ${{ env.GO_VERSION }}
24-
- name: Checkout code
25-
uses: actions/checkout@v4
2624
- name: Check go mod
2725
run: |
2826
go mod tidy
@@ -35,14 +33,15 @@ jobs:
3533
runs-on: ubuntu-latest
3634
steps:
3735
- uses: actions/checkout@v4
38-
- name: Install Go
39-
uses: actions/setup-go@v5
36+
- uses: actions/setup-go@v5
4037
with:
4138
# https://github.com/actions/setup-go#supported-version-syntax
4239
# ex:
4340
# - 1.18beta1 -> 1.18.0-beta.1
4441
# - 1.18rc1 -> 1.18.0-rc.1
45-
go-version: ${{ env.GO_VERSION }}
42+
# TODO(ldez) must be changed after the first release of golangci-lint with go1.23
43+
# go-version: ${{ env.GO_VERSION }}
44+
go-version: '1.22'
4645
- name: lint
4746
uses: golangci/[email protected]
4847
with:
@@ -53,13 +52,8 @@ jobs:
5352
runs-on: windows-latest
5453
steps:
5554
- uses: actions/checkout@v4
56-
- name: Install Go
57-
uses: actions/setup-go@v5
55+
- uses: actions/setup-go@v5
5856
with:
59-
# https://github.com/actions/setup-go#supported-version-syntax
60-
# ex:
61-
# - 1.18beta1 -> 1.18.0-beta.1
62-
# - 1.18rc1 -> 1.18.0-rc.1
6357
go-version: ${{ env.GO_VERSION }} # test only the latest go version to speed up CI
6458
- name: Run tests
6559
run: make.exe test
@@ -69,13 +63,8 @@ jobs:
6963
runs-on: macos-latest
7064
steps:
7165
- uses: actions/checkout@v4
72-
- name: Install Go
73-
uses: actions/setup-go@v5
66+
- uses: actions/setup-go@v5
7467
with:
75-
# https://github.com/actions/setup-go#supported-version-syntax
76-
# ex:
77-
# - 1.18beta1 -> 1.18.0-beta.1
78-
# - 1.18rc1 -> 1.18.0-rc.1
7968
go-version: ${{ env.GO_VERSION }} # test only the latest go version to speed up CI
8069
- name: Run tests
8170
run: make test
@@ -86,43 +75,27 @@ jobs:
8675
strategy:
8776
matrix:
8877
golang:
89-
- '1.21'
9078
- '1.22'
79+
- '1.23'
9180
steps:
9281
- uses: actions/checkout@v4
93-
- name: Install Go
94-
uses: actions/setup-go@v5
82+
- uses: actions/setup-go@v5
9583
with:
96-
# https://github.com/actions/setup-go#supported-version-syntax
97-
# ex:
98-
# - 1.18beta1 -> 1.18.0-beta.1
99-
# - 1.18rc1 -> 1.18.0-rc.1
10084
go-version: ${{ matrix.golang }}
101-
- uses: actions/cache@v4
102-
with:
103-
path: ~/go/pkg/mod
104-
key: ${{ runner.os }}-go-${{ matrix.golang }}-${{ hashFiles('**/go.sum') }}
105-
restore-keys: |
106-
${{ runner.os }}-go-${{ matrix.golang }}-
10785
- name: Run tests
10886
run: make test
10987

88+
# Checks: GitHub action assets
11089
check_generated:
111-
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors
11290
runs-on: ubuntu-latest
11391
steps:
11492
- uses: actions/checkout@v4
115-
- name: Unshallow
116-
run: git fetch --prune --unshallow
117-
- name: Install Go
118-
uses: actions/setup-go@v5
11993
with:
120-
# https://github.com/actions/setup-go#supported-version-syntax
121-
# ex:
122-
# - 1.18beta1 -> 1.18.0-beta.1
123-
# - 1.18rc1 -> 1.18.0-rc.1
94+
fetch-depth: 0
95+
- uses: actions/setup-go@v5
96+
with:
12497
go-version: ${{ env.GO_VERSION }}
125-
- name: Check generated files are up to date
98+
- name: Check generated files are up-to-date
12699
run: make fast_check_generated
127100
env:
128101
# needed for github-action-config.json generation
@@ -145,13 +118,8 @@ jobs:
145118
runs-on: ubuntu-latest
146119
steps:
147120
- uses: actions/checkout@v4
148-
- name: Install Go
149-
uses: actions/setup-go@v5
121+
- uses: actions/setup-go@v5
150122
with:
151-
# https://github.com/actions/setup-go#supported-version-syntax
152-
# ex:
153-
# - 1.18beta1 -> 1.18.0-beta.1
154-
# - 1.18rc1 -> 1.18.0-rc.1
155123
go-version: ${{ env.GO_VERSION }}
156124
- name: Build golangci-lint
157125
run: make build

.github/workflows/tag.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ jobs:
1212
# ex:
1313
# - 1.18beta1 -> 1.18.0-beta.1
1414
# - 1.18rc1 -> 1.18.0-rc.1
15-
GO_VERSION: '1.22'
15+
GO_VERSION: '1.23'
1616
CHOCOLATEY_VERSION: 2.2.0
1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Install Go
20-
uses: actions/setup-go@v5
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-go@v5
2122
with:
2223
go-version: ${{ env.GO_VERSION }}
23-
- name: Unshallow
24-
run: git fetch --prune --unshallow
2524

2625
- name: Install chocolatey
2726
run: |

.goreleaser.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
---
1+
version: 2
2+
23
project_name: golangci-lint
34

45
builds:

build/buildx-alpine.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1.4
2-
FROM golang:1.22-alpine
2+
FROM golang:1.23-alpine
33

44
# related to https://github.com/golangci/golangci-lint/issues/3107
55
ENV GOROOT /usr/local/go

build/buildx.Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1.4
2-
FROM golang:1.22
2+
FROM golang:1.23
33

44
# related to https://github.com/golangci/golangci-lint/issues/3107
55
ENV GOROOT /usr/local/go

0 commit comments

Comments
 (0)