Failures due to wong Go version detected
question
### Welcome
- [x] Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
- [x] Yes, I've searched similar issues on GitHub and didn't find any.
- [x] Yes, I've included all information below (version, config, etc).
### Description of the problem
I am trying to update my project Go version to 1.25, but golangci-lint action fail with the following error:
```
| level=info msg="[config_reader] Used config file .golangci.json"
| Error: can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.0)
| Failed executing command with error: can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.0)
```
ref https://github.com/kubevirt/ipam-extensions/actions/runs/22649554179/job/65645566525?pr=140#step:6:34
The issue is reproducable with `act`, using the following workflow yaml
### Version of golangci-lint
v2.0.2
### Version of the GitHub Action
v7
### Workflow file
reproducer.yaml:
```yml
name: Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
- name: Linters
uses: golangci/golangci-lint-action@v7
with:
version: v2.0.2
args: --timeout 3m --verbose cmd/... pkg/...
```
### Golangci-lint configuration
<details>
```yml
{
"formatters": {
"enable": [
"gofmt",
"goimports"
],
"exclusions": {
"generated": "lax",
"paths": [
"third_party$",
"builtin$",
"examples$"
]
}
},
"linters": {
"default": "none",
"enable": [
"copyloopvar",
"dupl",
"errcheck",
"goconst",
"gocyclo",
"govet",
"ineffassign",
"lll",
"misspell",
"nakedret",
"prealloc",
"staticcheck",
"unconvert",
"unused"
],
"exclusions": {
"generated": "lax",
"paths": [
"third_party$",
"builtin$",
"examples$"
],
"rules": [
{
"linters": [
"lll"
],
"path": "api/*"
},
{
"linters": [
"dupl",
"lll"
],
"path": "internal/*"
},
{
"linters": [
"lll"
],
"source": "^// \\+kubebuilder"
}
]
}
},
"run": {
"allow-parallel-runners": true
},
"version": "2"
}
```
</details>
### Go version
1.25
### Code example or link to a public repository
PR updating Go version to 1.25 and fail on golangci-lint action
https://github.com/kubevirt/ipam-extensions/pull/140
Reproducer:
```
# install act
$ curl https://raw.githubusercontent.com/nektos/act/refs/heads/master/install.sh | bash
# run the above workflow locally
$ ./act -W ./reproducer.yaml
```
关闭于 2026-03-04 2 条评论