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
@@ -76,7 +76,7 @@ func (d *Deps) log() logx.Logger {
|
||||
// При фатальном captcha-условии возвращает ErrFatal — вызывающий делает os.Exit
|
||||
// без вмешательства udprelay в хост-процесс.
|
||||
func Run(ctx context.Context, dtlsDialer *dtlsdial.Dialer, auth AuthHandler, logger logx.Logger, connectedStreams *atomic.Int32, params *Params, peer *net.UDPAddr, listenAddr string, numStreams int) error {
|
||||
listenConn, err := net.ListenPacket("udp", listenAddr)
|
||||
listenConn, err := (&net.ListenConfig{}).ListenPacket(ctx, "udp", listenAddr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("udprelay listen %s: %w", listenAddr, err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user