run: timeout: 5m tests: true linters: enable: - errcheck # 检查未处理的错误 - gosimple # 建议代码简化 - govet # Go静态分析 - ineffassign # 检查无效赋值 - staticcheck # 静态分析 - typecheck # 类型检查 - unused # 检查未使用的代码 - gofmt # 检查代码格式 - goimports # 检查导入顺序 - misspell # 检查拼写错误 - unconvert # 检查不必要的类型转换 - unparam # 检查未使用的参数 - gosec # 安全检查 - gocritic # Go代码审查 linters-settings: gosec: excludes: - G204 # 子进程审计(我们需要执行系统命令) gocritic: enabled-tags: - diagnostic - style - performance disabled-checks: - paramTypeCombine - whyNoLint issues: exclude-rules: # 忽略测试文件中的错误检查 - path: _test\.go linters: - errcheck - gosec # 忽略生成的文件 - path: ".*\\.pb\\.go" linters: - all max-issues-per-linter: 0 max-same-issues: 0 output: format: colored-line-number print-issued-lines: true print-linter-name: true