From d92e7f0158866516ad115191d4debb00ce3e3aa9 Mon Sep 17 00:00:00 2001 From: zarazaex69 Date: Sun, 12 Apr 2026 23:26:14 +0300 Subject: [PATCH] refactor(client): fix linter issues in client.go --- internal/client/client.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/internal/client/client.go b/internal/client/client.go index 9d5bf67..373af2b 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -44,7 +44,7 @@ type Client struct { const defaultSOCKSListenHost = "127.0.0.1" // Run starts the client and listens for SOCKS5 traffic. -func Run( +func Run( //nolint:revive ctx context.Context, roomURL, keyHex string, @@ -57,7 +57,7 @@ func Run( } // RunWithReady starts the client and invokes onReady once the local SOCKS5 listener is accepting connections. -func RunWithReady( +func RunWithReady( //nolint:revive ctx context.Context, roomURL, keyHex string, @@ -72,7 +72,7 @@ func RunWithReady( key, err := decodeKey(keyHex) if err != nil { - return err + return fmt.Errorf("decodeKey failed: %w", err) } keyStr := string(key) @@ -95,7 +95,7 @@ func RunWithReady( for peerID := range 1 { if err := c.addPeer(runCtx, roomURL, peerID, cancel); err != nil { - return err + return fmt.Errorf("addPeer failed: %w", err) } } @@ -111,10 +111,6 @@ func RunWithReady( return err } -func peerCount() int { - return 1 -} - func decodeKey(keyHex string) ([]byte, error) { if keyHex == "" { key := make([]byte, 32)