{"id":16767580,"url":"https://github.com/ii64/go-binder","last_synced_at":"2026-02-01T03:02:07.481Z","repository":{"id":45064379,"uuid":"387373910","full_name":"ii64/go-binder","owner":"ii64","description":"Go binding configuration and command flag made easy✨✨","archived":false,"fork":false,"pushed_at":"2022-10-26T16:27:24.000Z","size":2457,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T16:47:08.819Z","etag":null,"topics":["binder","cli-flags","config","flags","go","golang","json","toml","yaml"],"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/ii64.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":"2021-07-19T07:17:07.000Z","updated_at":"2024-04-30T07:16:07.000Z","dependencies_parsed_at":"2022-09-14T12:51:16.072Z","dependency_job_id":null,"html_url":"https://github.com/ii64/go-binder","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/ii64/go-binder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ii64%2Fgo-binder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ii64%2Fgo-binder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ii64%2Fgo-binder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ii64%2Fgo-binder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ii64","download_url":"https://codeload.github.com/ii64/go-binder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ii64%2Fgo-binder/sbom","scorecard":{"id":483217,"data":{"date":"2025-08-11","repo":{"name":"github.com/ii64/go-binder","commit":"7500088fd1206318d4ce50c28dad8dc46dbbf2a2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"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":"Code-Review","score":0,"reason":"Found 2/30 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":-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":"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":"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 '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 3 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-19T17:07:49.956Z","repository_id":45064379,"created_at":"2025-08-19T17:07:49.956Z","updated_at":"2025-08-19T17:07:49.956Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28965436,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T02:14:24.993Z","status":"ssl_error","status_checked_at":"2026-02-01T02:13:55.706Z","response_time":56,"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":["binder","cli-flags","config","flags","go","golang","json","toml","yaml"],"created_at":"2024-10-13T06:09:26.071Z","updated_at":"2026-02-01T03:02:07.466Z","avatar_url":"https://github.com/ii64.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"go-binder.png\" alt=\"go-binder\" width=\"35%\"/\u003e\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Go Reference](https://pkg.go.dev/badge/github.com/ii64/go-binder.svg)](https://pkg.go.dev/github.com/ii64/go-binder)\n[![DeepSource](https://deepsource.io/gh/ii64/go-binder.svg/?label=active+issues\u0026show_trend=true\u0026token=vJ6MknNoKFjEe4Fr1cTdsP0x)](https://deepsource.io/gh/ii64/go-binder/?ref=repository-badge)\n\n✨Binding configuration and command flag made easy!✨\n\nYou can use multiple keys tag to simplify the look like this [(supported feature\\*\\*)](https://github.com/golang/go/issues/40281):\n\n```go\n// single tag key\ntype MyConfig struct {\n    Token string `json:\"token_json\" xml:\"token_xml\" arg:\"token\" env:\"token\" environ:\"TOKEN\"`\n}\n// multiple tag keys\ntype MyConfig struct {\n    Token string `json xml bson yaml toml arg env:\"token\" environ:\"TOKEN\"`\n}\n```\n\nBelow is default mapping implementation of `binder.RegisterCmdArgs = defaultRegisterCmdArgsFlagStd` that use standard golang `flag` package to perform command flag.\n\nThe `\u003cparent\u003e` is a placeholder for parent key, `binder.BindArgs(Loaded, \"my\")` this case `\u003cparent\u003e` will be replaced with `my`, if there's field with type `struct` in the component, it'll be replaced to `my.\u003cstruct name | arg value\u003e.\u003cfield name | arg\u003e`\n\n| Tag               | Go Code                                                 | Description                                                                       |\n| ----------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------- |\n| `arg:\"token\"`     | `flag.StringVar(val, \"\u003cparent\u003e.token\", *val, argUsage)` | Used for binding flag with contextual key `\u003cparent\u003e`                              |\n| `argx:\"token\"`    | `flag.StringVar(val, \"token\", *val, argUsage)`          | Used for binding flag                                                             |\n| `bind:\"log\"`      | _No equivalent_                                         | Used for binder to differ `struct` parent sub context `\u003cparent\u003e.log.\u003cfield name\u003e` |\n| `env:\"token\"`     | `os.Getenv(\"\u003cparent\u003e.token\")`                           | Used for binding to environment variable with contextual key `\u003cparent\u003e`           |\n| `environ:\"token\"` | `os.Getenv(\"token\")`                                    | Used for binding to environment                                                   |\n| `usage:\"\u003cDESC\u003e\"`  | Used as `argUsage`                                      | Description for flag                                                              |\n| `ignore:\"true\"`   | _No equivalent_                                         | Ignore struct field                                                               |\n| `bind:\"abc\"`      | _No equivalent_                                         | Used for mapstructure (`bind` is default value of `binder.TagName`)               |\n\nOther:\n\n- `arg` and `argx` (dedicated) basically has same function.\n- `env` and `environ` (dedicated) basically has same function.\n- Currently you can't have _dedicated key_ for configuration because the way it parsed is from _Unmarshaller_ that results in `map[string]interface{}`, but this definitely possible to implement.\n\nMore thing you can learn from the example below.\n\n## Example\n\nSee more on [example](./_examples/) directory.\n\n\n```text\n$ ./main -h\nFilename \"config.json\" ext \".json\"\nUsage of ./main:\n  -dedicatedArg string\n    \n  -my.Ktes int\n    \n  -my.Sub.Hello string\n    \n  -my.Sub.PtrOfSub.YourName string\n        this is the usage\n  -my.Sub.SubOfSub.InSub\n    \n  -my.count int\n        this is the usage (default 121)\n  -my.log.Directory string\n    \n  -my.log.SubLog int\n    \n  -my.log.filename string\n    \n  -my.mycount int\n        this is the usage mycount\n  -my.mystring string\n        this is the usage mystring\n  -my.stringslice value\n        a string slice arg\n  -my.token string\n         (default \"some default value\")\n```\n\n### Note\n\nContributions are welcome\n\n```text\n**) Reverted feature as from 1.16 but found it useful\n```\n\n## License\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fii64%2Fgo-binder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fii64%2Fgo-binder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fii64%2Fgo-binder/lists"}