mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-06-07 12:54:43 +00:00
refactor(client): fix linter issues in client.go
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user