Skip to content

Commit

Permalink
feat:add Go workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Dopoil committed Oct 20, 2024
1 parent 1b08bfa commit 7ba7864
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions go-lint.yml
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

0 comments on commit 7ba7864

Please sign in to comment.