1
0
mirror of https://github.com/netbirdio/netbird.git synced 2025-07-09 10:57:31 +02:00

Struct Engine has methods on both value ()

Struct Engine has methods on both value and pointer receivers.
Such usage is not recommended by the Go Documentation.
This commit is contained in:
Zoltan Papp
2023-06-05 15:34:22 +02:00
committed by GitHub
parent 511f0a00be
commit dd69c1cd31

@ -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() e.syncMsgMux.Lock()
defer e.syncMsgMux.Unlock() defer e.syncMsgMux.Unlock()
_, ok := e.peerConns[peerKey] _, ok := e.peerConns[peerKey]
return ok 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) log.Debugf("creating peer connection %s", pubKey)
var stunTurn []*ice.URL var stunTurn []*ice.URL
stunTurn = append(stunTurn, e.STUNs...) stunTurn = append(stunTurn, e.STUNs...)