Skip to content

ameghdadian/itertools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

itertools

Go Report Card Go Reference CI Code Test Coverage

itertools provides tools to simplify working with Iterators(officially introduced in Go 1.23 release).

Example

    package main

    import (
        "fmt"
        "slices"
        "github.com/ameghdadian/itertools"
    )

    func main() {
        a := []int{1,2,3}
        b := []int{4,5,6}

        // Combine arbitrary number of slices into an iterator
        it := itertools.Concat(a,b)
        for v := range it {
            fmt.Println(v)
        }

        // Combine arbitrary number of iterators into a single iterator
        it1 := slices.Values(a)
        it2 := slices.Values(b)

        combined := itertools.ConcatIter(it1, it2)
        for v := range combined {
            fmt.Println(v)
        }

        // ...
    }

License

This is project is licensed under the Apache Version 2.0 License. See LICENSE for details.

About

Tools to simplify working with Iterators in Go.

Resources

License

Stars

Watchers

Forks

Packages

No packages published