Files
go-easy-utils/sliceUtil/chunk_slice_example_test.go
jeffery e9cc195c39 Feature/example test (#24)
example docs
2023-04-12 15:09:44 +08:00

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]]
}