Back to Lo

Core Range

docs/data/core-range.md

1.53.0192 B
Original Source

Creates a slice of integers of the given length starting at 0. Negative length produces a descending sequence.

go
lo.Range(4)
// []int{0, 1, 2, 3}

lo.Range(-4)
// []int{0, -1, -2, -3}