{"id":37175689,"url":"https://github.com/mtoohey31/iter","last_synced_at":"2026-01-14T20:30:41.810Z","repository":{"id":44675836,"uuid":"445666414","full_name":"mtoohey31/iter","owner":"mtoohey31","description":"Package iter provides generic, lazy iterators, functions for producing them from primitive types, as well as functions and methods for transforming and consuming them.","archived":true,"fork":false,"pushed_at":"2024-08-25T16:53:07.000Z","size":341,"stargazers_count":33,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-07T06:08:06.362Z","etag":null,"topics":["generic","generics","go","golang","iterator","lazy"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/mtoohey.com/iter/v2","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mtoohey31.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-01-07T22:16:51.000Z","updated_at":"2024-11-16T08:42:33.000Z","dependencies_parsed_at":"2024-02-09T23:25:19.270Z","dependency_job_id":"d50e393e-392d-4e1b-bb09-c33cdb678d0a","html_url":"https://github.com/mtoohey31/iter","commit_stats":{"total_commits":147,"total_committers":1,"mean_commits":147.0,"dds":0.0,"last_synced_commit":"659ed1bc1378321b4761590a1e74c0f49af18d5b"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mtoohey31/iter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtoohey31%2Fiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtoohey31%2Fiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtoohey31%2Fiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtoohey31%2Fiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mtoohey31","download_url":"https://codeload.github.com/mtoohey31/iter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mtoohey31%2Fiter/sbom","scorecard":{"id":666721,"data":{"date":"2025-08-11","repo":{"name":"github.com/mtoohey31/iter","commit":"44a4af9382ec84a1fc5c78574766dacbfe5b05d7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/mtoohey31/iter/ci.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/mtoohey31/iter/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/mtoohey31/iter/ci.yaml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":10,"reason":"project is fuzzed","details":["Info: GoBuiltInFuzzer integration found: chain_test.go:11","Info: GoBuiltInFuzzer integration found: chan_test.go:11","Info: GoBuiltInFuzzer integration found: chan_test.go:41","Info: GoBuiltInFuzzer integration found: cycle_test.go:11","Info: GoBuiltInFuzzer integration found: elems_test.go:11","Info: GoBuiltInFuzzer integration found: filter_test.go:11","Info: GoBuiltInFuzzer integration found: filter_test.go:34","Info: GoBuiltInFuzzer integration found: generator_test.go:11","Info: GoBuiltInFuzzer integration found: group_by_test.go:64","Info: GoBuiltInFuzzer integration found: inspect_test.go:11","Info: GoBuiltInFuzzer integration found: ints_test.go:14","Info: GoBuiltInFuzzer integration found: ints_test.go:30","Info: GoBuiltInFuzzer integration found: ints_test.go:47","Info: GoBuiltInFuzzer integration found: iter_test.go:13","Info: GoBuiltInFuzzer integration found: iter_test.go:25","Info: GoBuiltInFuzzer integration found: iter_test.go:50","Info: GoBuiltInFuzzer integration found: iter_test.go:75","Info: GoBuiltInFuzzer integration found: iter_test.go:100","Info: GoBuiltInFuzzer integration found: iter_test.go:112","Info: GoBuiltInFuzzer integration found: iter_test.go:126","Info: GoBuiltInFuzzer integration found: iter_test.go:156","Info: GoBuiltInFuzzer integration found: iter_test.go:186","Info: GoBuiltInFuzzer integration found: iter_test.go:218","Info: GoBuiltInFuzzer integration found: iter_test.go:236","Info: GoBuiltInFuzzer integration found: iter_test.go:254","Info: GoBuiltInFuzzer integration found: iter_test.go:314","Info: GoBuiltInFuzzer integration found: iter_test.go:352","Info: GoBuiltInFuzzer integration found: iter_test.go:379","Info: GoBuiltInFuzzer integration found: iter_test.go:399","Info: GoBuiltInFuzzer integration found: map_test.go:12","Info: GoBuiltInFuzzer integration found: map_test.go:44","Info: GoBuiltInFuzzer integration found: map_test.go:74","Info: GoBuiltInFuzzer integration found: map_test.go:120","Info: GoBuiltInFuzzer integration found: mutex_test.go:11","Info: GoBuiltInFuzzer integration found: ordered_iter_test.go:11","Info: GoBuiltInFuzzer integration found: ordered_iter_test.go:38","Info: GoBuiltInFuzzer integration found: ordered_iter_test.go:69","Info: GoBuiltInFuzzer integration found: ordered_iter_test.go:96","Info: GoBuiltInFuzzer integration found: ordered_iter_test.go:127","Info: GoBuiltInFuzzer integration found: partition_test.go:11","Info: GoBuiltInFuzzer integration found: seqs_test.go:11","Info: GoBuiltInFuzzer integration found: skipping_test.go:11","Info: GoBuiltInFuzzer integration found: string_test.go:13","Info: GoBuiltInFuzzer integration found: string_test.go:33","Info: GoBuiltInFuzzer integration found: string_test.go:64","Info: GoBuiltInFuzzer integration found: take_test.go:11","Info: GoBuiltInFuzzer integration found: take_test.go:29","Info: GoBuiltInFuzzer integration found: zip_test.go:12","Info: GoBuiltInFuzzer integration found: zip_test.go:31","Info: GoBuiltInFuzzer integration found: zip_test.go:49"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0603 / GHSA-hp87-p4gw-j4gq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T18:18:07.678Z","repository_id":44675836,"created_at":"2025-08-21T18:18:07.678Z","updated_at":"2025-08-21T18:18:07.678Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generic","generics","go","golang","iterator","lazy"],"created_at":"2026-01-14T20:30:41.200Z","updated_at":"2026-01-14T20:30:41.782Z","avatar_url":"https://github.com/mtoohey31.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e As of Go 1.23, the [`for ... := range ...` syntax](https://go.dev/ref/spec#For_range) can now be used with \"push-style\" iterator functions. Since this package implements a different \"pull-style\" of iterators which are incompatible with the `for ... := range ...` syntax, I've decided to archive it. If you're looking for pull-style equivalents of some of the functions in this package, I'd recommend checking out the [`x/exp/iter` package proposal](https://github.com/golang/go/issues/61898).\n\n# iter\n\nPackage iter provides generic, lazy iterators, functions for producing them from primitive types, as well as functions and methods for transforming and consuming them.\n\n## Usage\n\n\u003c!-- `$ cat _demos/hello-world/main.go` as go --\u003e\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"mtoohey.com/iter/v2\"\n)\n\nfunc main() {\n\tinitial := iter.Elems([]string{\"hello\", \"beautiful\", \"world\"})\n\tresult := initial.Filter(func(s string) bool {\n\t\treturn len(s) \u003c 6\n\t}).Map(strings.ToUpper).Collect()\n\tfmt.Println(result) // produces: [HELLO WORLD]\n}\n```\n\n## Regarding Performance\n\nThere is some overhead to using the iterators in this package, since each evaluation requires a function call, so if the performance of your application is a top priority, this package _might_ not be the best choice. Don't guess about performance though: I would recommend benchmarking to determine the impact of using iterators, because in some cases, lazy iterators may be faster than the equivalent strict loop.\n\n## Acknowledgements\n\n- Everyone that commented on my [r/golang post](https://www.reddit.com/r/golang/comments/s13jlz/iter_generic_lazy_iterators_for_go_118/)\n- The inspiration for my own attempt: \u003chttps://github.com/polyfloyd/go-iterator\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtoohey31%2Fiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtoohey31%2Fiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtoohey31%2Fiter/lists"}