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
@@ -78,7 +78,7 @@ func Run(ctx context.Context, deps *Deps, params *Params, peer *net.UDPAddr, lis
|
||||
case <-pool.Ready():
|
||||
}
|
||||
|
||||
listener, err := net.Listen("tcp", listenAddr)
|
||||
listener, err := (&net.ListenConfig{}).Listen(ctx, "tcp", listenAddr)
|
||||
if err != nil {
|
||||
wgMaint.Wait()
|
||||
return fmt.Errorf("tcpfwd listen %s: %w", listenAddr, err)
|
||||
@@ -104,7 +104,7 @@ func Run(ctx context.Context, deps *Deps, params *Params, peer *net.UDPAddr, lis
|
||||
if ctx.Err() != nil {
|
||||
wgConn.Wait()
|
||||
wgMaint.Wait()
|
||||
return nil
|
||||
return nil //nolint:nilerr // ctx cancel = clean shutdown, not an error
|
||||
}
|
||||
deps.log().Errorf("TCP accept error: %s", err)
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user