package
Version:
v0.0.1
Opens a new window with list of versions in this module.
Published: Mar 3, 2025
License: Apache-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Step struct {
Head int
Tail int
}
func New(len, step int) (steps []Step)
New returns steps for a slice.
Example:
arr := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
for _, step := range steps.New(len(arr), 6) {
cur := arr[step.Head:step.Tail]
// todo: do something
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.