-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy path.golangci.yml
More file actions
42 lines (38 loc) · 1017 Bytes
/
Copy path.golangci.yml
File metadata and controls
42 lines (38 loc) · 1017 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
42
version: "2"
run:
build-tags:
- sonic
timeout: 5m
linters:
default: none
enable:
- errcheck # 检查未处理的错误
- govet # 核心逻辑检查
- staticcheck # 大量的静态逻辑检查 (包含 gosimple)
- unused # 检查未使用的代码
# gosec 在 v2.11.1 + go1.26.1 下挂死,暂时禁用
# - gosec # 安全审计
- revive # 代码风格检查
- bodyclose # 确保 HTTP body 已关闭(防止连接泄漏)
settings:
revive:
rules:
# 禁用类型名称重叠检查(如 sql.SQLStore),重命名会破坏 API
- name: exported
arguments:
- "disableStutteringCheck"
# 禁用包名检查(util 等通用包名在 internal 中是合理的)
- name: var-naming
disabled: true
formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- ccLoad
issues:
exclude-dirs:
- vendor
- testdata