Skip to content

fix(ci): 修复 CI 流程版本不匹配问题并优化代码质量规范 - #2

Merged
wanglongan587 merged 6 commits into
ora-space:mainfrom
wanglongan587:main
Sep 8, 2026
Merged

fix(ci): 修复 CI 流程版本不匹配问题并优化代码质量规范#2
wanglongan587 merged 6 commits into
ora-space:mainfrom
wanglongan587:main

Conversation

@wanglongan587

Copy link
Copy Markdown
Collaborator

变更概述

修复 GitHub Actions CI 流水线中 Lint & Format Check 步骤报错失败的问题,对齐 Go 1.27 运行时生态并完善代码质量规范。

1. CI 流水线升级与适配

  • 升级 Go 运行时环境:更新 .github/workflows/ci.ymlsetup-go 版本至 1.27(启用 check-latest: true),与 go.mod (Go 1.27.1) 保持一致。
  • 升级 golangci-lint:适配兼容 Go 1.27 AST 的 golangci-lint v2 (go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest),并通过 golangci-lint migrate 保证规则集平滑解析。
  • 构建缓存与依赖预热:在 CI 静态检查阶段引入 go mod downloadgo build ./...,避免缺少模块缓存引发的类型推断异常。

2. 配置与规范修复

  • 配置修复:修正 .golangci.ymlrevive 配置项,将非法的 min-confidence: 0.8 修正为标准属性 confidence: 0.8
  • 标签修正:修正 internal/model/user.goID 字段的 gorm:"primaryKey" 标签。
  • 导入别名规范:在 pkg/logger/logger.go 中显式指定 lumberjack "gopkg.in/natefinch/lumberjack.v2" 别名,消除静态分析类型检查歧义。
  • 文档与注释补充:补充各内部业务包的标准 package 注释及导出常量/变量注释。

验证结果

  • 本地 task test 单元测试通过 (PASS)。
  • 远端 CI 流水线两个 Job(Test & CoverageLint & Format Check)均已全绿验证通过。

@wanglongan587
wanglongan587 merged commit 00e4358 into ora-space:main Sep 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant