{"id":13411632,"url":"https://github.com/srfrog/slices","last_synced_at":"2026-03-13T19:39:31.223Z","repository":{"id":38363879,"uuid":"276762750","full_name":"srfrog/slices","owner":"srfrog","description":"Functions that operate on slices. Similar to functions from package strings or package bytes that have been adapted to work with slices.","archived":false,"fork":false,"pushed_at":"2025-11-02T03:42:06.000Z","size":37,"stargazers_count":17,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-02T04:17:47.141Z","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/srfrog.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":"2020-07-02T23:17:34.000Z","updated_at":"2025-11-02T03:26:20.000Z","dependencies_parsed_at":"2022-07-12T17:27:52.551Z","dependency_job_id":null,"html_url":"https://github.com/srfrog/slices","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/srfrog/slices","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fslices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fslices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fslices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fslices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srfrog","download_url":"https://codeload.github.com/srfrog/slices/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srfrog%2Fslices/sbom","scorecard":{"id":843797,"data":{"date":"2025-08-11","repo":{"name":"github.com/srfrog/slices","commit":"7495c6bc42d6bee5166f5a3420f610f05956e316"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"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":"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":"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/5 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codecov.yml:1","Warn: no topLevel permission defined: .github/workflows/go.yml: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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/srfrog/slices/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/srfrog/slices/codecov.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codecov.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/srfrog/slices/codecov.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/srfrog/slices/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/srfrog/slices/go.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   2 out of   2 goCommand 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":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"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-23T21:00:30.091Z","repository_id":38363879,"created_at":"2025-08-23T21:00:30.091Z","updated_at":"2025-08-23T21:00:30.091Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30473450,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T17:15:31.527Z","status":"ssl_error","status_checked_at":"2026-03-13T17:15:22.394Z","response_time":60,"last_error":"SSL_read: 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":[],"created_at":"2024-07-30T20:01:15.196Z","updated_at":"2026-03-13T19:39:31.203Z","avatar_url":"https://github.com/srfrog.png","language":"Go","funding_links":[],"categories":["数据结构与算法","Data Structures and Algorithms","Generators","Data Structures","Uncategorized","数据结构`go语言实现的数据结构与算法`","数据结构"],"sub_categories":["杂项数据结构和算法","Miscellaneous Data Structures and Algorithms","Advanced Console UIs","标准 CLI"],"readme":"# Slices\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/srfrog/slices)](https://pkg.go.dev/github.com/srfrog/slices)\n[![Go Report Card](https://goreportcard.com/badge/github.com/srfrog/slices?svg=1)](https://goreportcard.com/report/github.com/srfrog/slices)\n[![codecov](https://codecov.io/gh/srfrog/slices/branch/master/graph/badge.svg?token=IDUWTIYYZQ)](https://codecov.io/gh/srfrog/slices)\n![Build Status](https://github.com/srfrog/slices/workflows/Go/badge.svg)\n\n*Functions that operate on slices. Similar to functions from `package strings` or `package bytes` that have been adapted to work with slices.*\n\n## Features\n\n- [x] Using a thin layer of idiomatic Go; correctness over performance.\n- [x] Provide most basic slice operations: index, trim, filter, map\n- [x] Some PHP favorites like: pop, push, shift, unshift, shuffle, etc...\n- [x] Non-destructive returns (won't alter original slice), except for explicit tasks.\n\n## Quick Start\n\nInstall using \"go get\":\n\n```bash\ngo get github.com/srfrog/slices\n```\n\nThen import from your source:\n\n```\nimport \"github.com/srfrog/slices\"\n```\n\nView [example_test.go][1] for examples of basic usage and features.\n\n## Documentation\n\nThe full code documentation is located at GoDoc:\n\n[http://godoc.org/github.com/srfrog/slices](http://godoc.org/github.com/srfrog/slices)\n\n## Usage\n\nThis is a en example showing basic usage.\n\n```go\npackage main\n\nimport(\n   \"fmt\"\n\n   \"github.com/srfrog/slices\"\n)\n\nfunc main() {\n\tstr := `Don't communicate by sharing memory - share memory by communicating`\n\n\t// Split string by spaces into a slice.\n\tslc := strings.Split(str, \" \")\n\n\t// Count the number of \"memory\" strings in slc.\n\tmemories := slices.Count(slc, \"memory\")\n\tfmt.Println(\"Memories:\", memories)\n\n\t// Split slice into two parts.\n\tparts := slices.Split(slc, \"-\")\n\tfmt.Println(\"Split:\", parts, len(parts))\n\n\t// Compare second parts slice with original slc.\n\tdiff := slices.Diff(slc, parts[1])\n\tfmt.Println(\"Diff:\", diff)\n\n\t// Chunk the slice\n\tchunks := slices.Chunk(parts[0], 1)\n\tfmt.Println(\"Chunk:\", chunks)\n\n\t// Merge the parts\n\tmerge := slices.Merge(chunks...)\n\tfmt.Println(\"Merge:\", merge)\n}\n```\n\n[1]: https://github.com/srfrog/slices/blob/master/example_test.go\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrfrog%2Fslices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrfrog%2Fslices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrfrog%2Fslices/lists"}