Skip to content

test: drop golang.org/x/sync dependency (errgroup → sync.WaitGroup)#59

Merged
VojtechVitek merged 1 commit into
masterfrom
deps/drop-x-sync
Jun 26, 2026
Merged

test: drop golang.org/x/sync dependency (errgroup → sync.WaitGroup)#59
VojtechVitek merged 1 commit into
masterfrom
deps/drop-x-sync

Conversation

@VojtechVitek

Copy link
Copy Markdown
Contributor

Removes the golang.org/x/sync dependency, which was only used by the test suite (errgroup in local_counter_test.go). The concurrent test goroutines now report failures directly via t.Errorf (safe for concurrent use), so errgroup's error aggregation isn't needed.

This is one part of reducing the module's dependency footprint as suggested by @lrstanley in #57. Credit for the idea goes to them.

Note: x/sync is a test-only dependency, so it doesn't propagate to consumers' builds — the benefit here is a tidier go.mod rather than a change to the dependency graph downstream users see. The zeebo/xxh3 part of #57 is handled/discussed separately.

  • go test ./... passes
  • go mod tidy drops golang.org/x/sync from go.mod/go.sum

🤖 Prepared with the help of Claude (AI), reviewed before opening.

Drops the golang.org/x/sync dependency, which was only used by the
test suite (errgroup in local_counter_test.go). The concurrent test
goroutines now report failures directly via t.Errorf, which is safe
for concurrent use, so errgroup's error aggregation is unnecessary.

Suggested by @lrstanley in #57 as part of reducing the module's
dependency footprint.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Benchmark Results

goos: linux
goarch: amd64
pkg: github.com/go-chi/httprate
cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
               │ master.txt  │               pr.txt               │
               │   sec/op    │   sec/op     vs base               │
LocalCounter-4   38.80m ± 1%   39.47m ± 2%  +1.71% (p=0.015 n=10)

               │  master.txt  │             pr.txt             │
               │     B/op     │     B/op      vs base          │
LocalCounter-4   2.846Mi ± 0%   2.853Mi ± 0%  ~ (p=0.436 n=10)

               │ master.txt  │            pr.txt             │
               │  allocs/op  │  allocs/op   vs base          │
LocalCounter-4   121.5k ± 0%   121.5k ± 0%  ~ (p=0.447 n=10)

@VojtechVitek VojtechVitek merged commit 0c2093a into master Jun 26, 2026
3 checks passed
@VojtechVitek VojtechVitek deleted the deps/drop-x-sync branch June 26, 2026 00:54
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.

1 participant