From 9aaed87b6942cb805d459d06477546b07b049826 Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Tue, 12 Nov 2024 21:41:25 -0800 Subject: [PATCH] Go 1 23 + linter (#131) * Bump fortio.org/fortio from 1.67.1 to 1.68.0 Bumps [fortio.org/fortio](https://github.com/fortio/fortio) from 1.67.1 to 1.68.0. - [Release notes](https://github.com/fortio/fortio/releases) - [Commits](https://github.com/fortio/fortio/compare/v1.67.1...v1.68.0) --- updated-dependencies: - dependency-name: fortio.org/fortio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * go 1.23 and lints --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- cb/cb_test.go | 20 ++++++++++---------- go.mod | 10 +++++----- go.sum | 16 ++++++++-------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cb/cb_test.go b/cb/cb_test.go index d4630c9..b70e51a 100644 --- a/cb/cb_test.go +++ b/cb/cb_test.go @@ -58,7 +58,7 @@ func testBoundaryConditions(t *testing.T, buffer cb.Queue[int]) { } // Test filling the buffer - for i := 0; i < capacity; i++ { + for i := range capacity { if !buffer.Push(i) { t.Errorf("Failed to push item %d to the buffer", i) } @@ -73,7 +73,7 @@ func testBoundaryConditions(t *testing.T, buffer cb.Queue[int]) { } // Test popping items from the full buffer - for i := 0; i < capacity; i++ { + for i := range capacity { item, ok := buffer.Pop() if !ok || item != i { t.Errorf("Popped item should be %d, got %d", i, item) @@ -86,14 +86,14 @@ func testBoundaryConditions(t *testing.T, buffer cb.Queue[int]) { go func() { defer wg.Done() - for i := 0; i < 100; i++ { + for i := range 100 { buffer.PushBlocking(i) } }() go func() { defer wg.Done() - for i := 0; i < 100; i++ { + for i := range 100 { item := buffer.PopBlocking() if item != i { t.Errorf("Popped item should be %d, got %d", i, item) @@ -154,7 +154,7 @@ func testProducerConsumerScenario(t *testing.T, buffer cb.Queue[int]) { producer := func(id int) { defer wg.Done() - for i := 0; i < 2; i++ { + for i := range 2 { buffer.PushBlocking(id*10 + i) } } @@ -170,7 +170,7 @@ func testProducerConsumerScenario(t *testing.T, buffer cb.Queue[int]) { } // Start 10 producer goroutines - for i := 0; i < 10; i++ { + for i := range 10 { go producer(i) } @@ -219,14 +219,14 @@ func benchmarkPushBlocking(b *testing.B, buffer cb.Queue[int], numProducers, num consN := b.N * numProducers producer := func() { defer wg.Done() - for i := 0; i < prodN; i++ { + for i := range prodN { buffer.PushBlocking(i) } } consumer := func() { defer wg.Done() - for i := 0; i < consN; i++ { + for range consN { buffer.PopBlocking() } } @@ -234,12 +234,12 @@ func benchmarkPushBlocking(b *testing.B, buffer cb.Queue[int], numProducers, num b.ResetTimer() // Start producer goroutines - for i := 0; i < numProducers; i++ { + for range numProducers { go producer() } // Start consumer goroutines - for i := 0; i < numConsumers; i++ { + for range numConsumers { go consumer() } diff --git a/go.mod b/go.mod index 26f128f..3f9d121 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,10 @@ module fortio.org/memstore -go 1.21 +go 1.23.3 require ( fortio.org/dflag v1.7.3 - fortio.org/fortio v1.67.1 + fortio.org/fortio v1.68.0 fortio.org/log v1.17.1 fortio.org/scli v1.15.3 fortio.org/sets v1.2.0 @@ -20,9 +20,9 @@ require ( github.com/kortschak/goroutine v1.1.2 // indirect golang.org/x/crypto/x509roots/fallback v0.0.0-20240904212608-c9da6b9a4008 // indirect golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect - golang.org/x/net v0.29.0 // indirect - golang.org/x/sys v0.25.0 // indirect - golang.org/x/text v0.18.0 // indirect + golang.org/x/net v0.31.0 // indirect + golang.org/x/sys v0.27.0 // indirect + golang.org/x/text v0.20.0 // indirect ) // replace fortio.org/scli => ../scli diff --git a/go.sum b/go.sum index 4f99656..e9fac5d 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ fortio.org/cli v1.9.2 h1:17eJ8QZPjXHcLBpeCe0QMO/0fj5Bw0ZTxVgL7V9jOqc= fortio.org/cli v1.9.2/go.mod h1:7r55OoTV8NXcTvJT4boWk8s3I2LP6TMZh/0LLMJEYw0= fortio.org/dflag v1.7.3 h1:yws+v+/fJ67bYgrgcWpLtgdZPEWkYuwdfqz/WyQ8UXo= fortio.org/dflag v1.7.3/go.mod h1:O1Pk4lKRolw9wwAGyjTo8IsNyqqNRQGKxPOfpOElMqM= -fortio.org/fortio v1.67.1 h1:KAYyeu6z/01d/QwJm2dCVIadAhd8jNsezJHhlkoOMwU= -fortio.org/fortio v1.67.1/go.mod h1:XfrXH/BJ/hhxBXHj9z8FaqvsBbnf46SLyoWtPgopDlU= +fortio.org/fortio v1.68.0 h1:2M9RuitiN+MgW6QlTJCHjW6PJLAPj/YCXegxSCLQ3rw= +fortio.org/fortio v1.68.0/go.mod h1:1IjDaEoT5crHBN7BRLBwrHE24pIT6rOPKrYG3jEIWaA= fortio.org/log v1.17.1 h1:YQoGyZBnXTVIs77/nZw7BppwSOIamP3I092PGBenBZs= fortio.org/log v1.17.1/go.mod h1:t58Spg9njjymvRioh5F6qKGSupEsnMjXLGWIS1i3khE= fortio.org/safecast v1.0.0 h1:dr3131WPX8iS1pTf76+39WeXbTrerDYLvi9s7Oi3wiY= @@ -28,9 +28,9 @@ golang.org/x/crypto/x509roots/fallback v0.0.0-20240904212608-c9da6b9a4008 h1:vKH golang.org/x/crypto/x509roots/fallback v0.0.0-20240904212608-c9da6b9a4008/go.mod h1:kNa9WdvYnzFwC79zRpLRMJbdEFlhyM5RPFBBZp/wWH8= golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= -golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= -golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/net v0.31.0 h1:68CPQngjLL0r2AlUKiSxtQFKvzRVbnzLwMUn5SzcLHo= +golang.org/x/net v0.31.0/go.mod h1:P4fl1q7dY2hnZFxEk4pPSkDHF+QqjitcnDjUQyMM+pM= +golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= +golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4=