Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Chunk ¶
Chunk Creates an array of elements split into groups the length of size.If array can't be split evenly, the final chunk will be the remaining elements.
Example ¶
anySource := []any{1, 2, 3, "jk", true, 0.069} intSource := []int{1, 2, 3, 4, 5, 6, 7, 8, 9} stringSource := []string{"a", "b", "c"} fmt.Println("any: ", Chunk(anySource, 2)) fmt.Println("int:", Chunk(intSource, 5)) fmt.Println("string:", Chunk(stringSource, 2))
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.