{"id":40898866,"url":"https://github.com/thecasualcoder/godash","last_synced_at":"2026-01-22T02:28:57.318Z","repository":{"id":96483733,"uuid":"214410618","full_name":"thecasualcoder/godash","owner":"thecasualcoder","description":"Lodash for Golang","archived":false,"fork":false,"pushed_at":"2019-10-25T10:02:31.000Z","size":166,"stargazers_count":44,"open_issues_count":9,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-06-20T11:14:57.192Z","etag":null,"topics":["lodash"],"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/thecasualcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/contributing.md","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,"publiccode":null,"codemeta":null}},"created_at":"2019-10-11T10:41:53.000Z","updated_at":"2023-12-05T06:20:50.000Z","dependencies_parsed_at":"2023-06-25T21:18:37.604Z","dependency_job_id":null,"html_url":"https://github.com/thecasualcoder/godash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thecasualcoder/godash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Fgodash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Fgodash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Fgodash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Fgodash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecasualcoder","download_url":"https://codeload.github.com/thecasualcoder/godash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecasualcoder%2Fgodash/sbom","scorecard":{"id":878111,"data":{"date":"2025-08-11","repo":{"name":"github.com/thecasualcoder/godash","commit":"7e5f9a5f8a6baaee8fda877202b1932b65109c9d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":4,"reason":"Found 6/14 approved changesets -- score normalized to 4","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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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":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":"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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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 23 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":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-24T06:52:27.438Z","repository_id":96483733,"created_at":"2025-08-24T06:52:27.438Z","updated_at":"2025-08-24T06:52:27.438Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28651581,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"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":["lodash"],"created_at":"2026-01-22T02:28:56.574Z","updated_at":"2026-01-22T02:28:57.311Z","avatar_url":"https://github.com/thecasualcoder.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Godash\n\n[![Build Status](https://travis-ci.org/thecasualcoder/godash.svg?branch=master)](https://travis-ci.org/thecasualcoder/godash)\n[![Go Doc](https://godoc.org/github.com/thecasualcoder/godash?status.svg)](https://godoc.org/github.com/thecasualcoder/godash)\n\n[![DeepSource](https://static.deepsource.io/deepsource-badge-light.svg)](https://deepsource.io/gh/thecasualcoder/godash/?ref=repository-badge)\n\nInspired from [Lodash](https://github.com/lodash/lodash) for golang\n\n## Why?\n\n- I did not like most map/reduce implementations that returned an `interface{}` which had to be typecasted. This library follows the concept of how `json.Marshal` works. Create an output variable **outside** the functions and pass a **pointer reference** to it, so it can be **set**.\n- This library heavily makes use of `reflect` package and hence will have an **impact on performance**. **DO NOT USE THIS IN PRODUCTION**. This repository is more of a way to learn the reflect package and measure its performance impact.\n- All functions have **validations** on how mapper function/predicate functions should be written. So even if we lose out on compile time validation, the library still **does not panic** if it does not know how to handle an argument passed to it.\n\n## Available Functions\n\n1. [Map](#Map)\n2. [Filter](#Filter)\n3. [Reduce](#Reduce)\n4. [Any](#Any-or-Some) or [Some](#Any-or-Some)\n5. [Find](#Find)\n6. [All](#All-or-Every) or [Every](#All-or-Every)\n\n## Usages\n\n### Map\n\nMap applies a mapper function on each element of an input and sets it in output.\nFor more [docs](https://godoc.org/github.com/thecasualcoder/godash#Map).\n\n```go\nfunc main() {\n\tinput := []int{1, 2, 3, 4, 5}\n\tvar output []int\n\n\tgodash.Map(input, \u0026output, func(el int) int {\n\t\treturn el * el\n\t})\n\n\tfmt.Println(output) // prints 1 4 9 16 25\n}\n```\n\n```go\ntype Person struct {\n\tName string\n\tAge Int\n}\n\nfunc main() {\n\tinput := []Person{\n\t\t{Name: \"John\", Age: 22},\n\t\t{Name: \"Doe\", Age: 23},\n\t}\n\tvar output []string\n\n\tgodash.Map(input, \u0026output, func(person Person) string {\n\t\treturn person.Name\n\t})\n\n\tfmt.Println(output) // prints John Doe\n}\n```\n\n```go\nfunc main() {\n\tinput := map[string]int{\n\t\t\t\"key1\": 1,\n\t\t\t\"key2\": 2,\n\t\t\t\"key3\": 3,\n\t\t}\n\tvar output []int\n\n\tgodash.Map(input, \u0026output, func(el int) int {\n\t\treturn el * el\n\t})\n\n\tfmt.Println(output) // prints 1 4 9\n}\n```\n\n### Filter\n\nFilter out elements that fail the predicate.\nFor more [docs](https://godoc.org/github.com/thecasualcoder/godash#Filter).\n\n```go\nfunc main() {\n\tinput := []int{1, 2, 3, 4, 5}\n\tvar output []int\n\n\tgodash.Filter(input, \u0026output, func(element int) bool {\n\t\treturn element % 2 == 0\n\t})\n\n\tfmt.Println(output) // prints 2 4\n}\n```\n\n```go\nfunc main() {\n\tinput := []Person{\n\t\t{Name: \"John\", Age: 20},\n\t\t{Name: \"Doe\", Age: 30},\n\t}\n\tvar output []string\n\n\tgodash.Filter(input, \u0026output, func(person Person) bool {\n\t\treturn person.Age \u003e 25\n\t})\n\n\tfmt.Println(output) // prints {Doe 30}\n}\n```\n\n### Reduce\n\nReduce can accept a reducer and apply the reducer on each element of the input slice while providing an accumulator to save the reduce output.\nFor more [docs](https://godoc.org/github.com/thecasualcoder/godash#Reduce).\n\n```go\nfunc main() {\n    input := []string{\"count\", \"words\", \"and\", \"print\", \"words\", \"count\"}\n\taccumulator := map[string]int{}\n\n\t_ = godash.Reduce(input, \u0026accumulator, func(acc map[string]int, element string) map[string]int {\n\t\tif _, present := acc[element]; present {\n\t\t\tacc[element] = acc[element] + 1\n\t\t} else {\n\t\t\tacc[element] = 1\n\t\t}\n\t\treturn acc\n\t})\n\n\tbytes, _ := json.MarshalIndent(accumulator, \"\", \"  \")\n\tfmt.Println(string(bytes))\n\n\t// Output:\n\t//{\n\t//   \"and\": 1,\n\t//   \"count\": 2,\n\t//   \"print\": 1,\n\t//   \"words\": 2\n\t//}\n\n}\n```\n\n```go\nfunc main() {\n\tinput := []Person{\n\t\t{Name: \"John\", Age: 22},\n\t\t{Name: \"Doe\", Age: 23},\n\t}\n\tvar output int\n\n\tgodash.Reduce(input, \u0026output, func(sum int, person Person) int {\n\t\treturn sum + person.Age\n\t})\n\n\tfmt.Println(output) // prints 45\n}\n```\n\n### Any or Some\n\nAny or Some checks if predicate returns truthy for any element of collection. Iteration is stopped once predicate returns truthy.\nFor more [docs](https://godoc.org/github.com/thecasualcoder/godash#Any).\n\n\n```go\nfunc main() {\n\tinput := []int{1, 2, 3, 4, 5}\n\tvar output []int\n\toutput, _ := godash.Any(input, func(num int) bool {\n\t\treturn num % 7 == 0\n\t})\n\tfmt.Println(output) // prints false\n}\n```\n\n```go\nfunc main() {\n\tinput := []Person{\n\t\t{Name: \"John\", Age: 25},\n\t\t{Name: \"Doe\", Age: 15},\n\t}\n\tvar output int\n\toutput, _ := godash.Some(input, func(person Person) bool {\n\t\treturn person.Age \u003c 18\n\t})\n\tfmt.Println(output) // prints true\n}\n```\n\n\n### Find\n\nReturns the first element which passes the predicate.\nFor more [docs](https://godoc.org/github.com/thecasualcoder/godash#Find).\n```go\nfunc main() {\n\tinput := []string{\"john\",\"wick\",\"will\"}\n\tvar output string\n\n\tgodash.Find(input, \u0026output, func(element string) bool {\n    \treturn strings.HasPrefix(element, \"w\") // starts with\n\t}\n\t// output is \"wick\"\n\tfmt.Println(output)\n}\n```\n\n### All or Every \n\nAll or Every checks if predicate returns truthy for all element of collection. Iteration is stopped once predicate returns falsely. \nFor more [docs](https://godoc.org/github.com/thecasualcoder/godash#All). \n\n```go \nfunc main() { \n\tinput := []int{1, 2, 3, 4, 5} \n\tvar output bool \n\toutput, _ := godash.All(input, func(num int) bool { \n\t\treturn num \u003e= 1 \n\t}) \n\tfmt.Println(output) // prints true \n} \n``` \n\n```go \nfunc main() { \n\tinput := []Person{ \n\t\t{Name: \"John\", Age: 25}, \n\t\t{Name: \"Doe\", Age: 15}, \n\t} \n\tvar output bool \n\toutput, _ := godash.Every(input, func(person Person) bool {\n\t\treturn person.Age \u003c 18 \n\t}) \n\tfmt.Println(output) // prints false \n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecasualcoder%2Fgodash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecasualcoder%2Fgodash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecasualcoder%2Fgodash/lists"}