on main help sign in
chore: run `modernize`
9c45643Andrey Nering
internal/csync/slices_test.go+4−4
@@ -266,22 +266,22 @@ func TestSlice(t *testing.T) {
266 var wg sync.WaitGroup
266 var wg sync.WaitGroup
267
267
268 // Concurrent appends
268 // Concurrent appends
269− for i := 0; i < numGoroutines; i++ {
269+ for i := range numGoroutines {
270 wg.Add(1)
270 wg.Add(1)
271 go func(start int) {
271 go func(start int) {
272 defer wg.Done()
272 defer wg.Done()
273− for j := 0; j < itemsPerGoroutine; j++ {
273+ for j := range itemsPerGoroutine {
274 s.Append(start*itemsPerGoroutine + j)
274 s.Append(start*itemsPerGoroutine + j)
275 }
275 }
276 }(i)
276 }(i)
277 }
277 }
278
278
279 // Concurrent reads
279 // Concurrent reads
280− for i := 0; i < numGoroutines; i++ {
280+ for range numGoroutines {
281 wg.Add(1)
281 wg.Add(1)
282 go func() {
282 go func() {
283 defer wg.Done()
283 defer wg.Done()
284− for j := 0; j < itemsPerGoroutine; j++ {
284+ for range itemsPerGoroutine {
285 s.Len() // Just read the length
285 s.Len() // Just read the length
286 }
286 }
287 }()
287 }()