stepkit

package
v0.10.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Split

func Split(length, step int) iter.Seq[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 stepkit.Split(len(arr), 6) {
	cur := arr[step.Head:step.Tail]
	// todo: do something
}

Types

type Step

type Step struct {
	Head int
	Tail int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL