{"id":23181140,"url":"https://github.com/joeshaw/envdecode","last_synced_at":"2025-10-25T16:44:59.840Z","repository":{"id":15487955,"uuid":"18221681","full_name":"joeshaw/envdecode","owner":"joeshaw","description":"Go package for populating structs from environment variables using struct tags","archived":false,"fork":false,"pushed_at":"2021-04-16T12:44:40.000Z","size":40,"stargazers_count":232,"open_issues_count":4,"forks_count":33,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-13T16:58:25.093Z","etag":null,"topics":["environment-variables","golang"],"latest_commit_sha":null,"homepage":null,"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/joeshaw.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":"2014-03-28T18:10:01.000Z","updated_at":"2025-08-04T16:09:24.000Z","dependencies_parsed_at":"2022-09-26T17:41:18.862Z","dependency_job_id":null,"html_url":"https://github.com/joeshaw/envdecode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joeshaw/envdecode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fenvdecode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fenvdecode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fenvdecode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fenvdecode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeshaw","download_url":"https://codeload.github.com/joeshaw/envdecode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeshaw%2Fenvdecode/sbom","scorecard":{"id":527318,"data":{"date":"2025-08-11","repo":{"name":"github.com/joeshaw/envdecode","commit":"099f1fc765bda57815221df48c4f00d1faa4dcd7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"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":"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":"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":"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":5,"reason":"Found 15/30 approved changesets -- score normalized to 5","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":"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":"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":"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 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"}}]},"last_synced_at":"2025-08-20T04:44:59.298Z","repository_id":15487955,"created_at":"2025-08-20T04:44:59.298Z","updated_at":"2025-08-20T04:44:59.298Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280987578,"owners_count":26425342,"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-25T02:00:06.499Z","response_time":81,"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":["environment-variables","golang"],"created_at":"2024-12-18T08:14:40.336Z","updated_at":"2025-10-25T16:44:59.809Z","avatar_url":"https://github.com/joeshaw.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# envdecode [![Travis-CI](https://travis-ci.org/joeshaw/envdecode.svg)](https://travis-ci.org/joeshaw/envdecode) [![GoDoc](https://godoc.org/github.com/joeshaw/envdecode?status.svg)](https://godoc.org/github.com/joeshaw/envdecode)\n\n`envdecode` is a Go package for populating structs from environment\nvariables.\n\n`envdecode` uses struct tags to map environment variables to fields,\nallowing you you use any names you want for environment variables.\n`envdecode` will recurse into nested structs, including pointers to\nnested structs, but it will not allocate new pointers to structs.\n\n## API\n\nFull API docs are available on\n[godoc.org](https://godoc.org/github.com/joeshaw/envdecode).\n\nDefine a struct with `env` struct tags:\n\n```go\ntype Config struct {\n    Hostname  string `env:\"SERVER_HOSTNAME,default=localhost\"`\n    Port      uint16 `env:\"SERVER_PORT,default=8080\"`\n\n    AWS struct {\n        ID        string   `env:\"AWS_ACCESS_KEY_ID\"`\n        Secret    string   `env:\"AWS_SECRET_ACCESS_KEY,required\"`\n        SnsTopics []string `env:\"AWS_SNS_TOPICS\"`\n    }\n\n    Timeout time.Duration `env:\"TIMEOUT,default=1m,strict\"`\n}\n```\n\nFields *must be exported* (i.e. begin with a capital letter) in order\nfor `envdecode` to work with them.  An error will be returned if a\nstruct with no exported fields is decoded (including one that contains\nno `env` tags at all).\nDefault values may be provided by appending \",default=value\" to the\nstruct tag. Required values may be marked by appending \",required\" to the\nstruct tag. Strict values may be marked by appending \",strict\" which will\nreturn an error on Decode if there is an error while parsing.\n\nThen call `envdecode.Decode`:\n\n```go\nvar cfg Config\nerr := envdecode.Decode(\u0026cfg)\n```\n\nIf you want all fields to act `strict`, you may use `envdecode.StrictDecode`:\n\n```go\nvar cfg Config\nerr := envdecode.StrictDecode(\u0026cfg)\n```\n\nAll parse errors will fail fast and return an error in this mode.\n\n## Supported types\n\n* Structs (and pointer to structs)\n* Slices of below defined types, separated by semicolon\n* `bool`\n* `float32`, `float64`\n* `int`, `int8`, `int16`, `int32`, `int64`\n* `uint`, `uint8`, `uint16`, `uint32`, `uint64`\n* `string`\n* `time.Duration`, using the [`time.ParseDuration()` format](http://golang.org/pkg/time/#ParseDuration)\n* `*url.URL`, using [`url.Parse()`](https://godoc.org/net/url#Parse)\n* Types those implement a `Decoder` interface\n\n## Custom `Decoder`\n\nIf you want a field to be decoded with custom behavior, you may implement the interface `Decoder` for the filed type.\n\n```go\ntype Config struct {\n  IPAddr IP `env:\"IP_ADDR\"`\n}\n\ntype IP net.IP\n\n// Decode implements the interface `envdecode.Decoder`\nfunc (i *IP) Decode(repl string) error {\n  *i = net.ParseIP(repl)\n  return nil\n}\n```\n\n`Decoder` is the interface implemented by an object that can decode an environment variable string representation of itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeshaw%2Fenvdecode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeshaw%2Fenvdecode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeshaw%2Fenvdecode/lists"}