hariprasadraja
10/1/2019 - 11:07 AM

go slice batch

splits the slice in batch

batchSize := 1
	var batches [][]Type
	for batchSize < len(arr) {
		arr, batches = arr[batchSize:], append(batches, arr[0:batchSize:batchSize])
	}

	batches = append(batches, arr)