From bc175ddde5ae478b2b78bc057aff309944c41501 Mon Sep 17 00:00:00 2001 From: Benjamin Pollack Date: Wed, 18 Feb 2026 18:46:41 +0000 Subject: [PATCH] fix: ignore the new errors found by the updated golint --- forwarder.go | 6 +++--- listener_test.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/forwarder.go b/forwarder.go index e2be507..a925772 100644 --- a/forwarder.go +++ b/forwarder.go @@ -77,7 +77,7 @@ func (e *endpointForwarder) handleConnection(ctx context.Context, conn net.Conn) // Connect to the backend server backend, err := e.connectToBackend(ctx) if err != nil { - conn.Close() + _ = conn.Close() // Could log the error here return } @@ -156,14 +156,14 @@ func (e *endpointForwarder) join(left, right net.Conn) { // Copy from left to right go func() { defer wg.Done() - defer right.Close() + defer right.Close() //nolint:errcheck _, _ = io.Copy(right, left) }() // Copy from right to left go func() { defer wg.Done() - defer left.Close() + defer left.Close() //nolint:errcheck _, _ = io.Copy(left, right) }() diff --git a/listener_test.go b/listener_test.go index 9db4823..11fca60 100644 --- a/listener_test.go +++ b/listener_test.go @@ -54,8 +54,8 @@ func TestWrapConnWithTLS(t *testing.T) { // Create a pipe for testing serverConn, clientConn := net.Pipe() - defer serverConn.Close() - defer clientConn.Close() + defer serverConn.Close() //nolint:errcheck + defer clientConn.Close() //nolint:errcheck // Apply TLS in a separate goroutine go func() { @@ -75,7 +75,7 @@ func TestWrapConnWithTLS(t *testing.T) { } // Close the client connection - clientTLS.Close() + _ = clientTLS.Close() }() // Wrap the server connection with TLS @@ -101,8 +101,8 @@ func TestWrapConnWithTLS(t *testing.T) { func TestWrapConnWithTLSNil(t *testing.T) { // Create a pipe for testing conn1, conn2 := net.Pipe() - defer conn1.Close() - defer conn2.Close() + defer conn1.Close() //nolint:errcheck + defer conn2.Close() //nolint:errcheck // Call wrapConnWithTLS with nil config result := wrapConnWithTLS(conn1, nil)