Documentation
¶
Overview ¶
Library that provides to create a sequence of something.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Linear ¶ added in v0.3.0
func Linear[Type constraints.Integer](begin, end Type, steps ...Type) []Type
Creates a slice of a linear sequence of integers from begin to end inclusive with the specified step.
If begin is greater than end, the returned sequence will be decreasing, otherwise it will be increasing.
If the step is not specified, a step of one will be used. If multiple steps are specified, the first one will be used.
If a zero or negative step is specified, the function will panic.
Example ¶
package main
import (
"fmt"
"github.com/akramarenkov/seq"
)
func main() {
fmt.Println(seq.Linear(1, 8, 3))
}
Output: [1 4 7 8]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.