iter

package
v0.0.0-...-0cf3de4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2016 License: MIT Imports: 0 Imported by: 0

README

See http://godoc.org/github.com/bradfitz/iter

Documentation

Overview

Package iter provides a syntantically different way to iterate over integers. That's it.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func N

func N(n int) []struct{}

N returns a slice of n 0-sized elements, suitable for ranging over.

For example:

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

... will print 0 to 9, inclusive.

It does not cause any allocations.

Example
package main

import (
	"fmt"

	"github.com/bradfitz/iter"
)

func main() {
	for i := range iter.N(4) {
		fmt.Println(i)
	}
}
Output:

0
1
2
3

Types

This section is empty.

Jump to

Keyboard shortcuts

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