{"id":16933713,"url":"https://github.com/yah01/container","last_synced_at":"2026-05-21T05:34:52.901Z","repository":{"id":57659090,"uuid":"472457437","full_name":"yah01/container","owner":"yah01","description":"Generic containers collection for golang","archived":false,"fork":false,"pushed_at":"2022-05-28T17:05:55.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T00:41:33.401Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yah01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-21T18:11:40.000Z","updated_at":"2022-03-21T18:11:51.000Z","dependencies_parsed_at":"2022-09-08T00:02:09.111Z","dependency_job_id":null,"html_url":"https://github.com/yah01/container","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yah01%2Fcontainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yah01%2Fcontainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yah01%2Fcontainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yah01%2Fcontainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yah01","download_url":"https://codeload.github.com/yah01/container/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244734197,"owners_count":20501018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-13T20:50:13.787Z","updated_at":"2026-05-21T05:34:47.876Z","avatar_url":"https://github.com/yah01.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Container\n\n## Get Started\n\n### Iterator\n```golang\nslice := cslice.NewSlice(5, 4, 3, 2, 1)\n\n\nfor iter := slice.Iter(); iter.Valid(); iter.Next() {\n    fmt.Print(iter.Value(),\" \")\n}\n\n// output:\n// 5 4 3 2 1\n```\n\nSome utils are very useful, use Map() to double all elements:\n```golang\nslice := cslice.NewSlice(5, 4, 3, 2, 1)\n\niter := Map(slice.Iter(), func(elem int) int {\n\t\treturn elem * 2\n\t})\n\nfor ; iter.Valid(); iter.Next() {\n    fmt.Print(iter.Value(),\" \")\n}\n\n// output:\n// 10 8 6 4 2\n```\n\nUse Reduce() to get bit-OR of all elements:\n```golang\nslice := cslice.NewSlice(5, 4, 3, 2, 1)\n\nresult := Reduce(slice.Iter(), func(result, elem int) int {\n\t\treturn result|elem\n\t})\n\nfmt.Print(result)\n\n// output:\n// 7\n```\n\nUse Enumerate() to get an iterator with index:\n```golang\nslice := cslice.NewSlice(5, 4, 3, 2, 1)\n\nfor iter := Enumerate(slice.Iter()); iter.Valid(); iter.Next() {\n    v := iter.Value()\n    fmt.Println(v.Idx, v.Value)\n}\n\n// output:\n// 0 5\n// 1 4\n// 2 3\n// 3 2\n// 4 1\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyah01%2Fcontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyah01%2Fcontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyah01%2Fcontainer/lists"}