-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.golangci.yml
More file actions
41 lines (36 loc) · 954 Bytes
/
Copy path.golangci.yml
File metadata and controls
41 lines (36 loc) · 954 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
40
41
run:
timeout: 5m
linters:
enable:
- errcheck # 检查未处理的 error
- gosimple # 简化代码建议
- govet # go vet 的超集
- ineffassign # 无效赋值检测
- staticcheck # 静态分析
- unused # 未使用的变量/函数
- misspell # 拼写检查
- gocritic # 代码质量检查
- bodyclose # HTTP response body 未关闭
- unconvert # 无用类型转换
- wastedassign # 浪费的赋值
linters-settings:
gocritic:
enabled-tags:
- diagnostic
- style
misspell:
locale: US
issues:
exclude-rules:
# 测试文件宽松一些
- path: _test\.go
linters:
- errcheck
- gocritic
# 允许未处理的 error 在 main.go 的 log.Fatal 中
- path: cmd/bot/main\.go
linters:
- errcheck
# 按文件聚合
max-issues-per-linter: 50
max-same-issues: 5