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)