Skip to content

Commit

Permalink
fix: handle ignored errors in test files
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryanbekhen committed Dec 9, 2024
1 parent ff6018a commit e1ba532
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/socks5/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
4 changes: 2 additions & 2 deletions pkg/socks5/socks5_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit e1ba532

Please sign in to comment.