-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
41 lines (32 loc) · 1009 Bytes
/
Copy path.golangci.yml
File metadata and controls
41 lines (32 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# golangci-lint 配置文件
# 参考文档: https://golangci-lint.run/docs/configuration/file/
version: "2"
# 运行配置
run:
timeout: 20m
# Linters 启用配置
linters:
enable:
# 推荐的基础 linters
- govet # Go 官方 vet 工具
- staticcheck # 静态分析(包含 gosimple)
- unused # 未使用代码检查
- ineffassign # 无效赋值检查
# 代码质量
- goconst # 重复字符串检查
- gocyclo # 圈复杂度检查
- gocritic # 代码审查
# SQL 相关
- rowserrcheck # SQL rows.Err() 检查
- sqlclosecheck # SQL Close() 检查
# 其他有用的 linters
- misspell # 拼写检查
- unconvert # 不必要的类型转换
- unparam # 未使用的函数参数
disable:
- errcheck # 错误检查过于严格,特别是在测试代码中
# Issues 配置
issues:
max-same-issues: 0
max-issues-per-linter: 0
new: false