I have an array of two dimensions, how do I, out of that, make multiple arrays with a single dimension?
I need separate arrays as I need to pass an array with a single dimension to another function.
actions := []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
batchSize := 3
batches := make([][]int, 0, (len(actions)+batchSize-1)/batchSize)
for batchSize < len(protoFiles) {
actions, batches = actions[batchSize:], append(batches, actions[0:batchSize:batchSize])
}
batches = append(batches, actions)