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:
Jakob Borg
2026-02-11 10:41:38 +00:00
committed by GitHub
parent 478d8a007d
commit dc2a77ab8e
44 changed files with 175 additions and 289 deletions
+10 -22
View File
@@ -256,36 +256,28 @@ func (f *sendReceiveFolder) pullerIteration(ctx context.Context, scanChan chan<-
f.sl.DebugContext(ctx, "Starting puller iteration", "copiers", f.Copiers, "pullerPendingKiB", f.PullerMaxPendingKiB)
updateWg.Add(1)
var changed int // only read after updateWg closes
go func() {
updateWg.Go(func() {
// dbUpdaterRoutine finishes when dbUpdateChan is closed
changed = f.dbUpdaterRoutine(dbUpdateChan)
updateWg.Done()
}()
})
for range f.Copiers {
copyWg.Add(1)
go func() {
copyWg.Go(func() {
// copierRoutine finishes when copyChan is closed
f.copierRoutine(ctx, copyChan, pullChan, finisherChan)
copyWg.Done()
}()
})
}
pullWg.Add(1)
go func() {
pullWg.Go(func() {
// pullerRoutine finishes when pullChan is closed
f.pullerRoutine(ctx, pullChan, finisherChan)
pullWg.Done()
}()
})
doneWg.Add(1)
// finisherRoutine finishes when finisherChan is closed
go func() {
doneWg.Go(func() {
f.finisherRoutine(ctx, finisherChan, dbUpdateChan, scanChan)
doneWg.Done()
}()
})
fileDeletions, dirDeletions, err := f.processNeeded(ctx, dbUpdateChan, copyChan, scanChan)
@@ -1534,14 +1526,10 @@ func (f *sendReceiveFolder) pullerRoutine(ctx context.Context, in <-chan pullBlo
continue
}
wg.Add(1)
go func() {
defer wg.Done()
wg.Go(func() {
defer requestLimiter.Give(bytes)
f.pullBlock(ctx, state, out)
}()
})
}
wg.Wait()
}