From ebd20466b9c9357528844acb7cb6ba14a0c4e4ed Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 22 Mar 2024 10:41:22 +1100 Subject: [PATCH] Separate some long lines --- tracker/udp.go | 6 +++++- tracker/udp/client.go | 13 +++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tracker/udp.go b/tracker/udp.go index cf681887..4c6c2a7d 100644 --- a/tracker/udp.go +++ b/tracker/udp.go @@ -29,7 +29,11 @@ func (c *udpClient) Close() error { return c.cl.Close() } -func (c *udpClient) Announce(ctx context.Context, req AnnounceRequest, opts trHttp.AnnounceOpt) (res AnnounceResponse, err error) { +func (c *udpClient) Announce( + ctx context.Context, + req AnnounceRequest, + opts trHttp.AnnounceOpt, +) (res AnnounceResponse, err error) { if req.IPAddress == 0 && opts.ClientIp4 != nil { // I think we're taking bytes in big-endian order (all IPs), and writing it to a natively // ordered uint32. This will be correctly ordered when written back out by the UDP client diff --git a/tracker/udp/client.go b/tracker/udp/client.go index 6b97ddcc..7f6d88a8 100644 --- a/tracker/udp/client.go +++ b/tracker/udp/client.go @@ -167,7 +167,12 @@ func (cl *Client) writeRequest( return } -func (cl *Client) requestWriter(ctx context.Context, action Action, body []byte, tId TransactionId) (err error) { +func (cl *Client) requestWriter( + ctx context.Context, + action Action, + body []byte, + tId TransactionId, +) (err error) { var buf bytes.Buffer for n := 0; ; n++ { err = cl.writeRequest(ctx, action, body, tId, &buf) @@ -192,7 +197,11 @@ func (me ErrorResponse) Error() string { return fmt.Sprintf("error response: %#q", me.Message) } -func (cl *Client) request(ctx context.Context, action Action, body []byte) (respBody []byte, addr net.Addr, err error) { +func (cl *Client) request( + ctx context.Context, + action Action, + body []byte, +) (respBody []byte, addr net.Addr, err error) { respChan := make(chan DispatchedResponse, 1) t := cl.Dispatcher.NewTransaction(func(dr DispatchedResponse) { respChan <- dr -- 2.44.0