iter

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package iter provides a utility function for creating a range of integers. It is designed to simplify iteration over a range of integers using for-range loops.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func N

func N(n int) []struct{}

N creates a slice of length 'n' containing empty struct{} elements. The primary purpose of this function is to simplify the creation of for-range loops with a specific number of iterations.

Parameters:

n: The length of the range to create, represented by the length of the returned slice.

Returns:

[]struct{}: A slice of length 'n' containing empty struct{} elements.

Example usage:

for i := range iter.N(5) {
    fmt.Println(i)
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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