From 219cc466c66b7d8002b2c815baf9903adbb2ea91 Mon Sep 17 00:00:00 2001 From: "M. J. Fromberger" Date: Tue, 20 Aug 2024 18:11:36 -0700 Subject: [PATCH] Use math/rand/v2 in benchmarks, too --- bench_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bench_test.go b/bench_test.go index c8e28d2..f3c8cb7 100644 --- a/bench_test.go +++ b/bench_test.go @@ -1,7 +1,7 @@ package taskgroup_test import ( - "math/rand" + "math/rand/v2" "sync" "testing" ) @@ -28,7 +28,7 @@ func BenchmarkChan(b *testing.B) { for i := 0; i < b.N; i++ { go func() { defer wg.Done() - ch <- rand.Intn(1000) + ch <- rand.IntN(1000) }() } wg.Wait() @@ -51,7 +51,7 @@ func BenchmarkLock(b *testing.B) { for i := 0; i < b.N; i++ { go func() { defer wg.Done() - report(rand.Intn(1000)) + report(rand.IntN(1000)) }() } wg.Wait()