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:
samosvalishe committed 2026-05-21 16:49:59 +03:00
1 parent dfbfae2901
commit 6c3d3d341c
19 files changed
+65 -52

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ import (
// DTLS handshake stuck so we can exercise the gate/cancel paths.
type fakePC struct{}
func (fakePC) ReadFrom(b []byte) (int, net.Addr, error) {
func (fakePC) ReadFrom(_ []byte) (int, net.Addr, error) {
select {} // block forever
}
func (fakePC) WriteTo(b []byte, _ net.Addr) (int, error) { return len(b), nil }
@@ -18,11 +18,11 @@ func TestHandshakeSemBlocksWhenFull(t *testing.T) {
d := &Dialer{HandshakeSem: sem}
pc, err := net.ListenPacket("udp", "127.0.0.1:0")
pc, err := net.ListenPacket("udp", "127.0.0.1:0") //nolint:noctx
if err != nil {
t.Fatalf("listen: %v", err)
}
defer pc.Close()
defer pc.Close() //nolint:errcheck
peer := &net.UDPAddr{IP: net.ParseIP("127.0.0.1"), Port: 1}
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)