diff --git a/wgengine/magicsock/magicsock_test.go b/wgengine/magicsock/magicsock_test.go index 188b79002..4782c3933 100644 --- a/wgengine/magicsock/magicsock_test.go +++ b/wgengine/magicsock/magicsock_test.go @@ -166,8 +166,8 @@ func serveSTUN(t *testing.T) (addr string, cleanupFn func()) { } } -func runSTUN(t *testing.T, pc net.PacketConn, stats *stunStats, done chan struct{}) { - defer func() { done <- struct{}{} }() +func runSTUN(t *testing.T, pc net.PacketConn, stats *stunStats, done chan<- struct{}) { + defer close(done) var buf [64 << 10]byte for {