Skip to content

Update dependencies, run go fix and support errors.Is on MultiError - #15

Merged
umputun merged 4 commits into
masterfrom
modernize-and-deps
Aug 18, 2026
Merged

Update dependencies, run go fix and support errors.Is on MultiError#15
umputun merged 4 commits into
masterfrom
modernize-and-deps

Conversation

@paskal

@paskal paskal commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Based on #14, please review that one first.

  • testify updated to v1.12.0, which also drops go-spew and go-difflib from the module graph, and the workflow moved to checkout@v7, setup-go@v7 and golangci-lint-action@v9. The minimal go version stays at 1.22.
  • go fix ./... replaced the counted loops with range-over-int and dropped the per-iteration loop variable copies, neither of which is needed since go 1.22.
  • MultiError implements Unwrap() []error, so errors.Is and errors.As match any of the collected errors, and Errors returns a copy of the slice, as the caller should not be able to change the content of the error. The README example is corrected as well, it passed a func(ctx context.Context) error to ErrSizedGroup.Go, which takes func() error.
  • The preemptive and discard tests compared runtime.NumGoroutine() against absolute numbers, which counts goroutines left over from the earlier tests; on master they fail in about two runs out of ten. The limit is relative to the count taken at the start of the test now, and the concurrency the options promise is checked directly by tracking how many functions run at once.

@paskal
paskal requested a review from umputun as a code owner August 18, 2026 21:23
@coveralls

coveralls commented Aug 18, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 32195109371

Warning

No base build found for commit 1d64c7b on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 98.87%

Details

  • Patch coverage: 6 of 6 lines across 1 file are fully covered (100%).

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 177
Covered Lines: 175
Line Coverage: 98.87%
Coverage Strength: 1806.77 hits per line

💛 - Coveralls

@paskal
paskal force-pushed the modernize-and-deps branch 2 times, most recently from 178891e to c1ba1b6 Compare August 18, 2026 22:27
Base automatically changed from fix-errsizedgroup-race to master August 18, 2026 22:57
paskal added 4 commits August 18, 2026 17:57
Bump testify to v1.12.0 and move the workflow to checkout@v7, setup-go@v7
and golangci-lint-action@v9. Push branch and tag filters spelled out as
"**" to keep actionlint happy.
Modernizers replace the counted loops with range-over-int, available
since go 1.22. The per-iteration loop variable copies are not needed
since the same version either.
Previously the preemptive and discard tests compared runtime.NumGoroutine
against absolute numbers, which counts goroutines left over from the
earlier tests and failed at random. The limit is now relative to the count
taken at the start of the test, and the concurrency the options promise is
checked directly by tracking how many functions run at once.
MultiError implements Unwrap() []error, so the error returned by Wait
matches any of the collected errors, the same way errors.Join behaves.
Errors returns a copy of the collected slice, as the caller shouldn't be
able to change the content of the error.
@umputun
umputun force-pushed the modernize-and-deps branch from c1ba1b6 to 58a25d8 Compare August 18, 2026 22:57
@umputun
umputun merged commit c9bd4b3 into master Aug 18, 2026
7 checks passed
@paskal
paskal deleted the modernize-and-deps branch August 18, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants