-
Notifications
You must be signed in to change notification settings - Fork 1
/
.golangci.yml
71 lines (69 loc) · 1.78 KB
/
.golangci.yml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
run:
timeout: 2m
linters:
disable-all: true
enable:
- asciicheck
- bodyclose
- deadcode
- dogsled
- errcheck
- funlen
- goconst
- gocritic
- gocyclo
- gofmt
- gomnd
- goprintffuncname
- gosimple
- govet
- maligned
- nakedret
- nestif
- nolintlint
- prealloc
- rowserrcheck
- staticcheck
- structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
- gosec
- misspell
- whitespace
- exhaustive #смотрит на соответствие между элементами enum и swich кейсами
- exportloopref #for _,p := []int{1, 2, 3} { s.Bar(&p) /* If s stores the pointer, it will be bug.*/ }
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed.
linters-settings:
maligned:
suggest-new: true
funlen:
lines: 80
statements: 40
prealloc:
# Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
# True by default.
simple: true
range-loops: true # Report preallocation suggestions on range loops, true by default
for-loops: true # Report preallocation suggestions on for loops, false by default
gocritic:
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks.
# Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags".
enabled-tags:
- diagnostic
- performance
disabled-checks:
- hugeParam
- rangeValCopy
exhaustive:
default-signifies-exhaustive: true
issues:
exclude-rules:
- path: _test\.go # to exclude all test files for linter errcheck
linters:
- errcheck
- linters:
- gosec
text: "G101:"