-
Notifications
You must be signed in to change notification settings - Fork 54
/
.golangci.yaml
45 lines (45 loc) · 1.02 KB
/
.golangci.yaml
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
43
44
45
run:
go: '1.22.0'
tests: false
issues:
exclude-dirs:
- "third_party"
- "api"
linters:
# disable-all: true # 关闭其他linter
enable: #下面注释的部分是因为golang1.20和 golangci-lint 有兼容问题
- asasalint
- asciicheck
- bidichk
- bodyclose
- durationcheck
# - errcheck
- errchkjson
- errorlint
# - exhaustive
# - exportloopref
- copyloopvar
# - gosec
- govet
- loggercheck
- makezero
- nilerr
- noctx
- reassign
- staticcheck
- typecheck
disable:
- unused
linters-settings:
# errcheck:
# check-type-assertions: true # 检查类型断言
errorlint:
errorf: true # 检查fmt.Errorf错误是否用%w
gosec:
excludes:
- G401 # Detect the usage of DES, RC4, MD5 or SHA1
- G501 # Import blocklist: crypto/md5
- G502 # Import blocklist: crypto/des
- G503 # Import blocklist: crypto/rc4
- G504 # Import blocklist: net/http/cgi
- G505 # Import blocklist: crypto/sha1