{"id":32523175,"url":"https://github.com/go-utils/chunk","last_synced_at":"2025-10-28T07:48:21.695Z","repository":{"id":64297909,"uuid":"565649629","full_name":"go-utils/chunk","owner":"go-utils","description":"Obtains an index of specified size length and returns it","archived":false,"fork":false,"pushed_at":"2022-11-14T03:43:38.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T12:44:44.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-utils.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}},"created_at":"2022-11-14T02:39:53.000Z","updated_at":"2024-06-20T12:44:44.010Z","dependencies_parsed_at":"2023-01-15T09:00:42.685Z","dependency_job_id":null,"html_url":"https://github.com/go-utils/chunk","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/go-utils/chunk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-utils%2Fchunk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-utils%2Fchunk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-utils%2Fchunk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-utils%2Fchunk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-utils","download_url":"https://codeload.github.com/go-utils/chunk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-utils%2Fchunk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281403418,"owners_count":26495042,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-10-28T07:48:13.429Z","updated_at":"2025-10-28T07:48:21.687Z","avatar_url":"https://github.com/go-utils.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this?\nObtains an index of specified size length and returns it.  \n\n# Usage\n\nhttps://go.dev/play/p/vdWueuK-S31\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/go-utils/chunk\"\n)\n\nfunc main() {\n\tarr := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}\n\n\tchunkedArr := make([][]int, 0)\n\t// chunk size is 3\n\tfor idx := range chunk.GetIndex(len(arr), 3) {\n\t\tchunkedArr = append(chunkedArr, arr[idx.From:idx.To])\n\t}\n\n\tfmt.Printf(\"%#v\\n\", chunkedArr)\n\t// Output: [][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}, []int{10}}\n\n\tchunkedArr = chunk.Chunking(append(arr, 11), 3)\n\tfmt.Printf(\"%#v\\n\", chunkedArr)\n\t// Output: [][]int{[]int{1, 2, 3}, []int{4, 5, 6}, []int{7, 8, 9}, []int{10, 11}}\n}\n```\n\n## License\n- Under the [MIT License](./LICENSE)\n- Copyright (C) 2022 go-utils\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-utils%2Fchunk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-utils%2Fchunk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-utils%2Fchunk/lists"}