-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Go Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Lint Code Base | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# 检出代码仓库 | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# 设置 Go 环境 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' # 根据 Go 版本进行变化 | ||
|
||
# 安装 golangci-lint 工具 | ||
- name: Install golangci-lint | ||
run: | | ||
go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
# 运行代码风格检查 | ||
- name: Run golangci-lint | ||
run: | | ||
golangci-lint run |