ci: 加 -race + golangci-lint(new-issues) + govulncheck/gitleaks 安全扫描
补齐审计指出的「CI 缺 lint/安全扫描/-race」低成本质量门: - go job:go test → go test -race(4 模块本地已验证 race-clean,ubuntu 自带 gcc)。 - lint job:golangci-lint(standard 集)仅 PR 跑 + only-new-issues —— 新代码必须干净, 存量 ~42 处(多为未检 Close/死代码)单独消化,不拿存量红门。加 .golangci.yml(测试放过 errcheck)。 - security job:govulncheck advisory(stdlib/nats CVE 靠 toolchain/依赖升级,只做可见性不阻断) + gitleaks 扫提交防密钥泄漏。 - 顺手清掉本会话新代码的 lint:blob GetBytes 的 defer Close、退款测试未检 CreateOrder。 注:gitleaks-action 个人/公开仓库免费;组织仓库需 GITLEAKS_LICENSE。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -81,7 +81,7 @@ func (s *Store) GetBytes(ctx context.Context, key string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer obj.Close()
|
||||
defer func() { _ = obj.Close() }()
|
||||
return io.ReadAll(obj)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user