From e11555218b65dfdf68d64e278fafb2967904d5e5 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 15 Jul 2023 02:37:03 +0200 Subject: [PATCH] client: Client.setupHijackConn: explicitly ignore errors Just making my IDE and some linters slightly happier. Signed-off-by: Sebastiaan van Stijn --- client/hijack.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/hijack.go b/client/hijack.go index 4dcaaca4c5..08f0744bd1 100644 --- a/client/hijack.go +++ b/client/hijack.go @@ -84,8 +84,8 @@ func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto // state. Setting TCP KeepAlive on the socket connection will prohibit // ECONNTIMEOUT unless the socket connection truly is broken if tcpConn, ok := conn.(*net.TCPConn); ok { - tcpConn.SetKeepAlive(true) - tcpConn.SetKeepAlivePeriod(30 * time.Second) + _ = tcpConn.SetKeepAlive(true) + _ = tcpConn.SetKeepAlivePeriod(30 * time.Second) } clientconn := httputil.NewClientConn(conn, nil) @@ -100,7 +100,7 @@ func (cli *Client) setupHijackConn(ctx context.Context, req *http.Request, proto return nil, "", err } if resp.StatusCode != http.StatusSwitchingProtocols { - resp.Body.Close() + _ = resp.Body.Close() return nil, "", fmt.Errorf("unable to upgrade to %s, received %d", proto, resp.StatusCode) } }