chore(lint): расширить golangci-конфиг и устранить замечания
- Добавить nilerr, contextcheck, noctx, unconvert, unparam, gocritic, prealloc; убрать пресет std-error-handling и check-blank - Заменить net.Dial/Listen/ListenPacket на context-aware варианты в tcpfwd, bondserver, tcpfwdserver, udprelay, udpserver - Убрать параметр typ из writeToNextLane (всегда FrameData) - Убрать лишний DohEndpoint из возвращаемых значений forwardRaw - Анонимные receivers для методов без доступа к self (logx, vkauth, doh) - Переименовать неиспользуемые параметры в _ (bondclient, bondserver, netconn, dtlsdial тесты) - cmd/client: unlambda fix StreamsAlive → connectedStreams.Load
This commit is contained in:
1 parent
dfbfae2901
commit
6c3d3d341c
19 files changed
+65
-52
No files matched your search
+14
-3
@@ -6,13 +6,18 @@ linters:
|
||||
- bodyclose
|
||||
- misspell
|
||||
- revive
|
||||
- nilerr
|
||||
- contextcheck
|
||||
- noctx
|
||||
- unconvert
|
||||
- unparam
|
||||
- gocritic
|
||||
- prealloc
|
||||
settings:
|
||||
errcheck:
|
||||
check-type-assertions: true
|
||||
check-blank: true
|
||||
exclude-functions:
|
||||
- (net.PacketConn).WriteTo
|
||||
- (net.Conn).Write
|
||||
- encoding/json.MarshalIndent
|
||||
- (*github.com/pion/dtls/v3.Conn).SetDeadline
|
||||
govet:
|
||||
@@ -38,13 +43,15 @@ linters:
|
||||
- name: unexported-return
|
||||
- name: indent-error-flow
|
||||
- name: errorf
|
||||
- name: unused-parameter
|
||||
- name: superfluous-else
|
||||
- name: unused-receiver
|
||||
exclusions:
|
||||
generated: lax
|
||||
presets:
|
||||
- comments
|
||||
- common-false-positives
|
||||
- legacy
|
||||
- std-error-handling
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
@@ -53,6 +60,10 @@ linters:
|
||||
- linters:
|
||||
- errcheck
|
||||
source: "doRequest|packetPool\\.Get"
|
||||
- linters:
|
||||
- gocritic
|
||||
path: "^cmd/"
|
||||
text: "exitAfterDefer"
|
||||
issues:
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
|
||||
Reference in new issue
Block a user