Skip to content

Commit af204e3

Browse files
authored
upgrade Go to 1.25 (#929)
* go 1.25 * toolchain go1.25.5 * golangci/golangci-lint-action@v8 * migrate golangci to v2
1 parent 9e0b15b commit af204e3

12 files changed

Lines changed: 181 additions & 94 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install Go
2525
uses: actions/setup-go@v5
2626
with:
27-
go-version: '1.24'
27+
go-version-file: go.mod
2828
cache: true
2929

3030
- name: Build
@@ -90,7 +90,7 @@ jobs:
9090
- name: Install Go
9191
uses: actions/setup-go@v5
9292
with:
93-
go-version: '1.24'
93+
go-version-file: go.mod
9494
cache: true
9595

9696
- name: Run docker containers
@@ -161,21 +161,17 @@ jobs:
161161
- name: Install Go
162162
uses: actions/setup-go@v5
163163
with:
164-
go-version: '1.24'
164+
go-version-file: go.mod
165165
cache: true
166166

167167
- name: Lint
168-
uses: golangci/golangci-lint-action@v3
168+
uses: golangci/golangci-lint-action@v8
169169
with:
170170
version: latest
171171
only-new-issues: false
172172
args: --timeout 5m
173-
# Package/build cache already provided above.
174-
#
175-
# Disable module cache.
176-
skip-pkg-cache: true
177-
# Disable build cache.
178-
skip-build-cache: true
173+
skip-cache: true
174+
skip-save-cache: true
179175

180176
check-generate:
181177
runs-on: ubuntu-latest
@@ -186,7 +182,7 @@ jobs:
186182
- name: Install Go
187183
uses: actions/setup-go@v5
188184
with:
189-
go-version: '1.24'
185+
go-version-file: go.mod
190186
cache: true
191187

192188
- name: Generate doc
@@ -210,7 +206,7 @@ jobs:
210206
- name: Install Go
211207
uses: actions/setup-go@v5
212208
with:
213-
go-version: '1.24'
209+
go-version-file: go.mod
214210
cache: true
215211

216212
- name: Download dependencies

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install Go
2121
uses: actions/setup-go@v5
2222
with:
23-
go-version: '1.24'
23+
go-version: '1.25'
2424
cache: true
2525

2626
- name: Run GoReleaser

.golangci.bck.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
linters-settings:
2+
forbidigo:
3+
forbid:
4+
- ^print.*$
5+
- p: ^fmt\.Print.*$
6+
msg: Do not commit print statements.
7+
govet:
8+
enable:
9+
- composites
10+
disable:
11+
- printf
12+
dupl:
13+
threshold: 120
14+
goconst:
15+
min-len: 2
16+
min-occurrences: 3
17+
misspell:
18+
locale: US
19+
gocritic:
20+
enabled-tags:
21+
- diagnostic
22+
- experimental
23+
- opinionated
24+
- performance
25+
- style
26+
disabled-checks:
27+
- whyNoLint
28+
- commentFormatting # insane-doc syntax requires "//>" format
29+
- paramTypeCombine
30+
- ptrToRefParam # we use interface pointer in many places
31+
- unnamedResult
32+
- sprintfQuotedString
33+
- tooManyResultsChecker
34+
gosec:
35+
excludes:
36+
- G304 # Potential file inclusion via variable -- it's ok for this project
37+
stylecheck:
38+
checks:
39+
- '-ST1021' # insane-doc syntax requires "//>" format
40+
41+
linters:
42+
disable-all: true
43+
enable:
44+
- forbidigo
45+
- dogsled
46+
- dupl
47+
- errcheck
48+
- goconst
49+
- gocritic
50+
- goimports
51+
- gosimple
52+
- govet
53+
- ineffassign
54+
- misspell
55+
- nakedret
56+
- prealloc
57+
- stylecheck
58+
- typecheck
59+
- unconvert
60+
- unparam
61+
- unused
62+
- usestdlibvars
63+
- whitespace
64+
# Do not enable:
65+
# - staticcheck (does not work with golangci-lint 1.46.2 and go 1.18.2)
66+
# - gosec (not worth it in scope of this project)
67+
# - gochecknoglobals (we know when it is ok to use globals)
68+
# - gochecknoinits (we know when it is ok to use inits)
69+
70+
issues:
71+
exclude-use-default: false
72+
exclude-rules:
73+
# Disable linters that are annoying in tests.
74+
- path: _test\.go
75+
linters:
76+
- gocyclo
77+
- errcheck
78+
- dupl
79+
- gosec
80+
- goconst
81+
82+
# Ignore shadowing of err.
83+
- linters: [ govet ]
84+
text: 'declaration of "(err|ctx)"'
85+
86+
run:
87+
build-tags:
88+
- e2e
89+
- fuzz

.golangci.yml

Lines changed: 73 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,90 @@
1-
linters-settings:
2-
forbidigo:
3-
forbid:
4-
- ^print.*$
5-
- p: ^fmt\.Print.*$
6-
msg: Do not commit print statements.
7-
govet:
8-
enable:
9-
- composites
10-
disable:
11-
- printf
12-
dupl:
13-
threshold: 120
14-
goconst:
15-
min-len: 2
16-
min-occurrences: 3
17-
misspell:
18-
locale: US
19-
gocritic:
20-
enabled-tags:
21-
- diagnostic
22-
- experimental
23-
- opinionated
24-
- performance
25-
- style
26-
disabled-checks:
27-
- whyNoLint
28-
- commentFormatting # insane-doc syntax requires "//>" format
29-
- paramTypeCombine
30-
- ptrToRefParam # we use interface pointer in many places
31-
- unnamedResult
32-
- sprintfQuotedString
33-
- tooManyResultsChecker
34-
gosec:
35-
excludes:
36-
- G304 # Potential file inclusion via variable -- it's ok for this project
37-
stylecheck:
38-
checks:
39-
- '-ST1021' # insane-doc syntax requires "//>" format
40-
1+
version: "2"
2+
run:
3+
build-tags:
4+
- e2e
5+
- fuzz
416
linters:
42-
disable-all: true
7+
default: none
438
enable:
44-
- forbidigo
459
- dogsled
4610
- dupl
4711
- errcheck
12+
- forbidigo
4813
- goconst
4914
- gocritic
50-
- goimports
51-
- gosimple
5215
- govet
5316
- ineffassign
5417
- misspell
5518
- nakedret
5619
- prealloc
57-
- stylecheck
58-
- typecheck
20+
- staticcheck
5921
- unconvert
6022
- unparam
6123
- unused
6224
- usestdlibvars
6325
- whitespace
64-
# Do not enable:
65-
# - staticcheck (does not work with golangci-lint 1.46.2 and go 1.18.2)
66-
# - gosec (not worth it in scope of this project)
67-
# - gochecknoglobals (we know when it is ok to use globals)
68-
# - gochecknoinits (we know when it is ok to use inits)
69-
70-
issues:
71-
exclude-use-default: false
72-
exclude-rules:
73-
# Disable linters that are annoying in tests.
74-
- path: _test\.go
75-
linters:
76-
- gocyclo
77-
- errcheck
78-
- dupl
79-
- gosec
80-
- goconst
81-
82-
# Ignore shadowing of err.
83-
- linters: [ govet ]
84-
text: 'declaration of "(err|ctx)"'
85-
86-
run:
87-
build-tags:
88-
- e2e
89-
- fuzz
26+
settings:
27+
dupl:
28+
threshold: 120
29+
forbidigo:
30+
forbid:
31+
- pattern: ^print.*$
32+
- pattern: ^fmt\.Print.*$
33+
msg: Do not commit print statements.
34+
goconst:
35+
min-len: 2
36+
min-occurrences: 3
37+
gocritic:
38+
disabled-checks:
39+
- whyNoLint
40+
- commentFormatting
41+
- paramTypeCombine
42+
- ptrToRefParam
43+
- unnamedResult
44+
- sprintfQuotedString
45+
- tooManyResultsChecker
46+
enabled-tags:
47+
- diagnostic
48+
- experimental
49+
- opinionated
50+
- performance
51+
- style
52+
gosec:
53+
excludes:
54+
- G304
55+
govet:
56+
enable:
57+
- composites
58+
disable:
59+
- printf
60+
misspell:
61+
locale: US
62+
staticcheck:
63+
checks:
64+
- -ST1021
65+
exclusions:
66+
generated: lax
67+
rules:
68+
- linters:
69+
- dupl
70+
- errcheck
71+
- goconst
72+
- gocyclo
73+
- gosec
74+
path: _test\.go
75+
- linters:
76+
- govet
77+
text: declaration of "(err|ctx)"
78+
paths:
79+
- third_party$
80+
- builtin$
81+
- examples$
82+
formatters:
83+
enable:
84+
- goimports
85+
exclusions:
86+
generated: lax
87+
paths:
88+
- third_party$
89+
- builtin$
90+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ gen-doc:
5555

5656
.PHONY: lint
5757
lint:
58-
go run github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VER} run
58+
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VER} run
5959

6060
.PHONY: mock
6161
mock:

build/package/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG APP_IMAGE=ubuntu:latest
22

33
# Build
4-
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS build
4+
FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS build
55

66
ARG VERSION
77
ARG BUILD_TIME

build/package/Dockerfile.scratch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG APP_IMAGE=ubuntu:latest
22

33
# Build
4-
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS build
4+
FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS build
55

66
ARG VERSION
77
ARG BUILD_TIME

build/package/Dockerfile_dev

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG APP_IMAGE=ubuntu:latest
22

33
# Build
4-
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS build
4+
FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS build
55

66
ARG VERSION
77
ARG BUILD_TIME
@@ -17,6 +17,7 @@ COPY . .
1717
ENV CGO_ENABLED 0
1818
ENV GOOS linux
1919
ENV GOARCH amd64
20+
# ENV GOEXPERIMENT greenteagc
2021

2122
RUN go build -trimpath \
2223
-pgo default.pgo \

build/package/Dockerfile_playground

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG APP_IMAGE=alpine:latest
22

33
# Build
4-
FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS build
4+
FROM --platform=$BUILDPLATFORM golang:1.25-alpine AS build
55

66
ARG VERSION
77
ARG TARGETARCH

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/ozontech/file.d
22

3-
go 1.24.0
3+
go 1.25
44

5-
toolchain go1.24.6
5+
toolchain go1.25.5
66

77
require (
88
github.com/ClickHouse/ch-go v0.65.1

0 commit comments

Comments
 (0)