From 445df50dcf76b6172dc4688c2097c47878f41641 Mon Sep 17 00:00:00 2001 From: Simon Law Date: Tue, 24 Nov 2026 23:34:41 -0800 Subject: [PATCH] wgengine/magicsock: avoid copying lock in Test_endpoint_handlePongConnLocked (#22641) This patch removes an accidental copy of a lock: $ ./tool/go vet ./... literal copies lock value from pm: tailscale.com/wgengine/magicsock.peerMap contains sync.RWMutex Updates #22645 Change-Id: Id171051838b66b8dd9dff755d803bbc18142bea4 Signed-off-by: Simon Law --- wgengine/magicsock/endpoint_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wgengine/magicsock/endpoint_test.go b/wgengine/magicsock/endpoint_test.go index ce9b83269..478fec6b1 100644 --- a/wgengine/magicsock/endpoint_test.go +++ b/wgengine/magicsock/endpoint_test.go @@ -741,10 +741,9 @@ func Test_endpoint_handlePongConnLocked(t *testing.T) { t.Run(tc.name, func(t *testing.T) { synctest.Test(t, func(t *testing.T) { now := mono.Now() // synctest to match this to the internal 'now' - pm := newPeerMap() c := &Conn{ logf: func(msg string, args ...any) {}, - peerMap: pm, + peerMap: newPeerMap(), } c.discoAtomic.Set(key.NewDisco()) de := &endpoint{