Skip to content

Commit 05e8075

Browse files
thinkthinkingclaude
andcommitted
ci: 用 go-version-file 读取 go.mod 版本,修复工具链不匹配
go.mod 在依赖整理时被提升到 go 1.25.0,但 workflow 硬编码 1.24, 导致 CI 在 GOTOOLCHAIN=local 下报 'requires go >= 1.25.0'。 改用 go-version-file: go.mod,CI 版本随 go.mod 自动跟随,不再漂移。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 138764d commit 05e8075

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v6
2121
with:
22-
go-version: "1.24"
22+
# 从 go.mod 读取版本,避免与 go 指令漂移。
23+
go-version-file: go.mod
2324
cache: true
2425

2526
- name: Run GoReleaser

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
- name: Set up Go
1515
uses: actions/setup-go@v6
1616
with:
17-
go-version: "1.24"
17+
# 从 go.mod 读取版本,避免与 go 指令漂移。
18+
go-version-file: go.mod
1819
cache: true
1920

2021
- name: gofmt check

0 commit comments

Comments
 (0)