chore: build with Go 1.26; use Go 1.25 features (#10570)
WaitGroup.Go and built-in gomaxprocs handling. Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
@@ -378,11 +378,8 @@ func TestUnsubscribeContention(t *testing.T) {
|
||||
|
||||
stopListeners := make(chan struct{})
|
||||
var listenerWg sync.WaitGroup
|
||||
listenerWg.Add(listeners)
|
||||
for i := 0; i < listeners; i++ {
|
||||
go func() {
|
||||
defer listenerWg.Done()
|
||||
|
||||
listenerWg.Go(func() {
|
||||
s := l.Subscribe(AllEvents)
|
||||
defer s.Unsubscribe()
|
||||
|
||||
@@ -394,7 +391,7 @@ func TestUnsubscribeContention(t *testing.T) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
// Start senders. These send pointless events until the stop channel is
|
||||
@@ -403,11 +400,8 @@ func TestUnsubscribeContention(t *testing.T) {
|
||||
stopSenders := make(chan struct{})
|
||||
defer close(stopSenders)
|
||||
var senderWg sync.WaitGroup
|
||||
senderWg.Add(senders)
|
||||
for i := 0; i < senders; i++ {
|
||||
go func() {
|
||||
defer senderWg.Done()
|
||||
|
||||
senderWg.Go(func() {
|
||||
t := time.NewTicker(time.Millisecond)
|
||||
|
||||
for {
|
||||
@@ -419,7 +413,7 @@ func TestUnsubscribeContention(t *testing.T) {
|
||||
return
|
||||
}
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
// Give everything time to start up.
|
||||
|
||||
Reference in New Issue
Block a user