mirror of
https://github.com/jefferyjob/go-easy-utils.git
synced 2025-10-22 06:29:24 +08:00
14 lines
239 B
Go
14 lines
239 B
Go
package sliceUtil
|
|
|
|
import "fmt"
|
|
|
|
func ExampleChunkSlice() {
|
|
slice := []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k"}
|
|
res := ChunkSlice(slice, 3)
|
|
|
|
fmt.Printf("%+v", res)
|
|
|
|
// Output:
|
|
// [[a b c] [d e f] [g h i] [j k]]
|
|
}
|