From dd69c1cd3131ea636fac5cf2623c6fd1f8ac1b91 Mon Sep 17 00:00:00 2001 From: Zoltan Papp Date: Mon, 5 Jun 2023 15:34:22 +0200 Subject: [PATCH] Struct Engine has methods on both value (#934) Struct Engine has methods on both value and pointer receivers. Such usage is not recommended by the Go Documentation. --- client/internal/engine.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/internal/engine.go b/client/internal/engine.go index 228d97d3a..289f80c2a 100644 --- a/client/internal/engine.go +++ b/client/internal/engine.go @@ -793,14 +793,14 @@ func (e *Engine) connWorker(conn *peer.Conn, peerKey string) { } } -func (e Engine) peerExists(peerKey string) bool { +func (e *Engine) peerExists(peerKey string) bool { e.syncMsgMux.Lock() defer e.syncMsgMux.Unlock() _, ok := e.peerConns[peerKey] return ok } -func (e Engine) createPeerConn(pubKey string, allowedIPs string) (*peer.Conn, error) { +func (e *Engine) createPeerConn(pubKey string, allowedIPs string) (*peer.Conn, error) { log.Debugf("creating peer connection %s", pubKey) var stunTurn []*ice.URL stunTurn = append(stunTurn, e.STUNs...)