主要修复: - errcheck: defer Close 使用 //nolint:errcheck,类型断言改为 ok 检查 - govet fieldalignment: 调整结构体字段顺序优化内存布局 - revive unused-parameter: 将未使用参数改为 _ - exhaustive: 添加缺失的 switch case 或 default - goconst: 提取重复字符串为常量 (accessAllow, accessDeny 等) - staticcheck SA9003: 修复空分支逻辑 - gofmt: 运行 gofmt -w 格式化 - nolintlint: 修复 nolint 注释格式 其他改进: - 更新 .golangci.yml 配置,启用更严格的检查 - 移除未使用的代码和导入 - 简化测试辅助函数调用 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 新增 NewRequestCtx 和 NewRequestCtxWithHeader 辅助函数 - 简化各测试文件中 RequestCtx 创建代码 - 减少测试代码重复,提高可维护性 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
提供日志输出、响应输出、HTTP 状态码常量 API: ngx.log, ngx.say, ngx.print, ngx.flush, ngx.exit, ngx.redirect Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>