S1-B D5 门禁: lint 清零(golangci v2.1.6 首跑 27 条→0)——errcheck 21 处(defer Close 闭包化/多返回值 _ 接收)+staticcheck 2(QF1003 tagged switch/S1005 死赋值)+unused 4(测试死 helper 删除)+ineffassign 2(死存储消除:longsms fragsJSON/timer err);全量 -race 35 包回归绿(唯一 FAIL=router TestPick1000QPS 已知挂起项:待 MySQL 起后走 POC 同口径 MySQL 模式复验)

This commit is contained in:
2026-11-13 17:07:32 +08:00
parent 5c8393ea3f
commit e03b63dd5e
42 changed files with 1571 additions and 98 deletions
+3 -3
View File
@@ -316,14 +316,14 @@ func writeCSV(path string, recs []rec) {
log.Printf("[产物] CSV 创建失败: %v", err)
return
}
defer f.Close()
f.WriteString("ts,mobile,msg_id,result,latency_ms,error\n")
defer func() { _ = f.Close() }()
_, _ = f.WriteString("ts,mobile,msg_id,result,latency_ms,error\n")
for _, r := range recs {
errStr := r.Err
if errStr == "" && r.Result != 0 {
errStr = fmt.Sprintf("result=%d", r.Result)
}
fmt.Fprintf(f, "%s,%s,%d,%d,%.3f,%s\n",
_, _ = fmt.Fprintf(f, "%s,%s,%d,%d,%.3f,%s\n",
r.Ts.Format("15:04:05.000"), r.Mobile, r.MsgID, r.Result, r.Matency(), errStr)
}
}
+1 -1
View File
@@ -32,7 +32,7 @@ func main() {
lg := a.Lg()
accountID := int64(3)
if v := os.Getenv("RECON_ACCOUNT"); v != "" {
fmt.Sscan(v, &accountID)
_, _ = fmt.Sscan(v, &accountID)
}
sf, err := util.NewSnowflake(9)