mirror of
https://github.com/juanfont/headscale.git
synced 2026-09-10 10:41:32 +09:00
all: use sync.WaitGroup.Go
Drops the Add/Done bookkeeping, which in batcher.go was spread across three functions.
This commit is contained in:
committed by
Kristoffer Dalby
parent
245b81401c
commit
373c60efe3
+5
-11
@@ -735,17 +735,11 @@ func assertClientsState(t *testing.T, clients []TailscaleClient) {
|
||||
var wg sync.WaitGroup
|
||||
|
||||
for _, client := range clients {
|
||||
wg.Add(1)
|
||||
|
||||
c := client // Avoid loop pointer
|
||||
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
|
||||
assertValidStatus(t, c)
|
||||
assertValidNetcheck(t, c)
|
||||
assertValidNetmap(t, c)
|
||||
}()
|
||||
wg.Go(func() {
|
||||
assertValidStatus(t, client)
|
||||
assertValidNetcheck(t, client)
|
||||
assertValidNetmap(t, client)
|
||||
})
|
||||
}
|
||||
|
||||
t.Logf("waiting for client state checks to finish")
|
||||
|
||||
Reference in New Issue
Block a user