Revert e5998399c87e9f2de47e5108df584283db3c7fbd...46fe561befe97672f770640f831a9a545c77e540 on SliceTricks

Ian Lance Taylor 2020-06-08 13:19:47 -07:00
parent 46fe561bef
commit 93fa5681d0

@ -177,7 +177,7 @@ Useful if you want to do batch processing on large slices.
```go
actions := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
batchSize := 3
batches := make([][]int, 0, (len(actions) / batchSize + 1))
batches := make([][]int, 0, (len(actions) + batchSize - 1) / batchSize)
for batchSize < len(actions) {
actions, batches = actions[batchSize:], append(batches, actions[0:batchSize:batchSize])