mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
chore: upgrade golangci-lint configuration and optimize codebase (#4236)
This PR includes the following changes: - **Upgrade `.golangci.yml`**: Updated the configuration file to align with the latest golangci-lint version, ensuring compatibility and leveraging new features. - **Refactor GitHub Action workflow**: Modified `golangci-lint.yml` in the GitHub Actions workflow to reflect the updated configuration and improve CI performance. - **Codebase optimization**: Refactored code to address issues and warnings raised by the updated golangci-lint rules, including: - Improved function length and complexity. - Enhanced error handling and variable naming conventions. - Fixed minor issues such as unused imports and formatting inconsistencies. These changes aim to maintain code quality, ensure compatibility with the latest tools, and improve overall maintainability.
This commit is contained in:
8
.github/workflows/golangci-lint.yml
vendored
8
.github/workflows/golangci-lint.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
golang-ci:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ 'stable' ]
|
||||
go-version: [ "1.22", "1.23", "1.24" ]
|
||||
|
||||
name: golang-ci-lint
|
||||
runs-on: ubuntu-latest
|
||||
@ -41,11 +41,11 @@ jobs:
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
- name: golang-ci-lint
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
uses: golangci/golangci-lint-action@v7
|
||||
with:
|
||||
# Required: specify the golangci-lint version without the patch version to always use the latest patch.
|
||||
version: v1.64.5
|
||||
version: v2.1.1
|
||||
only-new-issues: true
|
||||
skip-cache: true
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --timeout 3m0s --config=.golangci.yml -v
|
||||
args: --config=.golangci.yml -v
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
||||
- name: Set Up Golang Environment
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.23.4
|
||||
go-version: 1.24.2
|
||||
|
||||
- name: Build CLI Binary
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user