From e1ba532d14247bf80767639befb79419b8c9564b Mon Sep 17 00:00:00 2001 From: Achmad Irianto Eka Putra Date: Mon, 9 Dec 2024 21:49:36 +0700 Subject: [PATCH] fix: handle ignored errors in test files Removed error handling where errors are intentionally ignored in socks5_test.go and request_test.go. This change maintains code readability and ensures clarity in test conditions where the error value is deemed unimportant. --- pkg/socks5/request_test.go | 2 +- pkg/socks5/socks5_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/socks5/request_test.go b/pkg/socks5/request_test.go index 418c1c4..f53549a 100644 --- a/pkg/socks5/request_test.go +++ b/pkg/socks5/request_test.go @@ -84,7 +84,7 @@ func Test_NewRequest(t *testing.T) { assert.Fail(t, "expected ping, got %s", string(buf)) } - _, err = conn.Write([]byte("pong")) + _, _ = conn.Write([]byte("pong")) }() lAddr := l.Addr().(*net.TCPAddr) s := &Server{ diff --git a/pkg/socks5/socks5_test.go b/pkg/socks5/socks5_test.go index 2871f31..6c12d7b 100644 --- a/pkg/socks5/socks5_test.go +++ b/pkg/socks5/socks5_test.go @@ -403,8 +403,8 @@ func TestRequest_CommandNotSupported(t *testing.T) { buf.Write(port) resp := &MockConn{} - req, err := NewRequest(buf) - err = s.handleRequest(req, resp) + req, _ := NewRequest(buf) + err := s.handleRequest(req, resp) assert.Error(t, err) out := resp.buf.Bytes()