fix(ci): 修复 CI 流程版本不匹配问题并优化代码质量规范 - #2
Merged
Conversation
added 6 commits
September 8, 2026 20:06
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更概述
修复 GitHub Actions CI 流水线中
Lint & Format Check步骤报错失败的问题,对齐 Go 1.27 运行时生态并完善代码质量规范。1. CI 流水线升级与适配
.github/workflows/ci.yml中setup-go版本至1.27(启用check-latest: true),与go.mod(Go 1.27.1) 保持一致。golangci-lint v2(go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest),并通过golangci-lint migrate保证规则集平滑解析。go mod download与go build ./...,避免缺少模块缓存引发的类型推断异常。2. 配置与规范修复
.golangci.yml中revive配置项,将非法的min-confidence: 0.8修正为标准属性confidence: 0.8。internal/model/user.go中ID字段的gorm:"primaryKey"标签。pkg/logger/logger.go中显式指定lumberjack "gopkg.in/natefinch/lumberjack.v2"别名,消除静态分析类型检查歧义。验证结果
task test单元测试通过 (PASS)。Test & Coverage与Lint & Format Check)均已全绿验证通过。