all: use sync.WaitGroup.Go

Drops the Add/Done bookkeeping, which in batcher.go was spread across
three functions.
This commit is contained in:
Kristoffer Dalby
2026-08-25 09:43:47 +00:00
committed by Kristoffer Dalby
parent 245b81401c
commit 373c60efe3
9 changed files with 46 additions and 106 deletions
+3 -7
View File
@@ -104,17 +104,13 @@ func TestConcurrentPutNodeSameGivenNameAllUnique(t *testing.T) {
var wg sync.WaitGroup
results := make(chan string, N)
for i := range N {
wg.Add(1)
go func(id int) {
defer wg.Done()
for id := range N {
wg.Go(func() {
n := createTestNode(types.NodeID(id+1), 1, "alice", "laptop") //nolint:gosec // test ids
view := store.PutNode(n)
results <- view.GivenName()
}(i)
})
}
wg.Wait()