ranges

package
v0.93.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Char

func Char(begin, end rune) iterators.Iterator[rune]
Example
package main

import (
	"fmt"
	"github.com/adamluzsi/frameless/ports/iterators/ranges"
)

func main() {
	iter := ranges.Char('A', 'Z')
	defer iter.Close()

	for iter.Next() {
		// prints characters between A and Z
		// A, B, C, D... Z
		fmt.Println(string(iter.Value()))
	}

	if err := iter.Err(); err != nil {
		panic(err.Error())
	}
}
Output:

func Int

func Int(begin, end int) iterators.Iterator[int]
Example
package main

import (
	"fmt"
	"github.com/adamluzsi/frameless/ports/iterators/ranges"
)

func main() {
	iter := ranges.Int(1, 9)
	defer iter.Close()

	for iter.Next() {
		// prints characters between 1 and 9
		// 1, 2, 3, 4, 5, 6, 7, 8, 9
		fmt.Println(iter.Value())
	}

	if err := iter.Err(); err != nil {
		panic(err.Error())
	}
}
Output:

Types

This section is empty.

Jump to

Keyboard shortcuts

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