fix: use WaitGroup.Go() for modernize linter
Some checks failed
Build and Release / Lint and Test (push) Successful in 19m14s
Build and Release / Build Binaries (amd64, windows) (push) Has been cancelled
Build and Release / Build Binaries (arm64, darwin) (push) Has been cancelled
Build and Release / Build Binaries (arm64, linux) (push) Has been cancelled
Build and Release / Build Docker Image (push) Has been cancelled
Build and Release / Create Release (push) Has been cancelled
Build and Release / Build Binaries (amd64, linux) (push) Has been cancelled
Build and Release / Build Binaries (amd64, darwin) (push) Has been cancelled

Replace wg.Add(1)/go func()/defer wg.Done() pattern with
the simpler wg.Go() method as required by the modernize linter.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
David H. Friedel Jr. 2026-01-09 18:11:52 -05:00
parent 4d1d81e8b3
commit 778f4dff1f
2 changed files with 4 additions and 8 deletions

View File

@ -367,9 +367,7 @@ func uploadChunks(ctx context.Context, server, token string, session *UploadSess
// Start workers // Start workers
for range parallel { for range parallel {
wg.Add(1) wg.Go(func() {
go func() { //nolint:modernize // Using separate error channel for first-error semantics
defer wg.Done()
for job := range jobs { for job := range jobs {
err := uploadChunk(server, token, session.ID, job.number, job.data) err := uploadChunk(server, token, session.ID, job.number, job.data)
if err != nil { if err != nil {
@ -378,7 +376,7 @@ func uploadChunks(ctx context.Context, server, token string, session *UploadSess
} }
tracker.Add(int64(len(job.data))) tracker.Add(int64(len(job.data)))
} }
}() })
} }
// Progress display // Progress display

View File

@ -173,9 +173,7 @@ func (cu *ChunkedUpload) uploadChunks(ctx context.Context, reader io.ReaderAt) e
// Start workers // Start workers
for range cu.options.Parallel { for range cu.options.Parallel {
wg.Add(1) wg.Go(func() {
go func() { //nolint:modernize // Using separate error channel for first-error semantics
defer wg.Done()
for j := range jobs { for j := range jobs {
if err := cu.uploadChunk(ctx, j.number, j.data); err != nil { if err := cu.uploadChunk(ctx, j.number, j.data); err != nil {
errors <- err errors <- err
@ -184,7 +182,7 @@ func (cu *ChunkedUpload) uploadChunks(ctx context.Context, reader io.ReaderAt) e
atomic.AddInt64(&cu.bytesWritten, int64(len(j.data))) atomic.AddInt64(&cu.bytesWritten, int64(len(j.data)))
cu.reportProgress() cu.reportProgress()
} }
}() })
} }
// Queue chunks // Queue chunks