From 552936674c9c55cfa3bbe87cdc74464a899fef6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E3=81=AE=E3=81=8B=E3=81=88=E3=81=A7?= Date: Thu, 7 Apr 2022 00:06:08 +0800 Subject: [PATCH] Style: formart code by gofumpt --- proxy/trojan/server.go | 3 ++- transport/internet/sockopt_windows.go | 3 ++- transport/internet/udp/dispatcher_packetaddr.go | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/proxy/trojan/server.go b/proxy/trojan/server.go index 0892f619f..e628e6968 100644 --- a/proxy/trojan/server.go +++ b/proxy/trojan/server.go @@ -245,7 +245,8 @@ func (s *Server) handleUDPPayload(ctx context.Context, clientReader *PacketReade func (s *Server) handleConnection(ctx context.Context, sessionPolicy policy.Session, destination net.Destination, clientReader buf.Reader, - clientWriter buf.Writer, dispatcher routing.Dispatcher) error { + clientWriter buf.Writer, dispatcher routing.Dispatcher, +) error { ctx, cancel := context.WithCancel(ctx) timer := signal.CancelAfterInactivity(ctx, cancel, sessionPolicy.Timeouts.ConnectionIdle) ctx = policy.ContextWithBufferPolicy(ctx, sessionPolicy.Buffer) diff --git a/transport/internet/sockopt_windows.go b/transport/internet/sockopt_windows.go index 1e182a516..eca97278a 100644 --- a/transport/internet/sockopt_windows.go +++ b/transport/internet/sockopt_windows.go @@ -1,8 +1,9 @@ package internet import ( - "golang.org/x/sys/windows" "syscall" + + "golang.org/x/sys/windows" ) const ( diff --git a/transport/internet/udp/dispatcher_packetaddr.go b/transport/internet/udp/dispatcher_packetaddr.go index ac1a5595f..f59422aa9 100644 --- a/transport/internet/udp/dispatcher_packetaddr.go +++ b/transport/internet/udp/dispatcher_packetaddr.go @@ -48,7 +48,8 @@ func NewPacketAddrDispatcherCreator(ctx context.Context) PacketAddrDispatcherCre } func (pdc *PacketAddrDispatcherCreator) NewPacketAddrDispatcher( - dispatcher routing.Dispatcher, callback ResponseCallback) DispatcherI { + dispatcher routing.Dispatcher, callback ResponseCallback, +) DispatcherI { packetConn, _ := packetaddr.CreatePacketAddrConn(pdc.ctx, dispatcher, false) pd := &PacketAddrDispatcher{conn: packetConn, callback: callback, ctx: pdc.ctx} go pd.readWorker()