{"id":26197430,"url":"https://github.com/golift/cnfg","last_synced_at":"2026-02-17T07:57:32.189Z","repository":{"id":46576424,"uuid":"228104777","full_name":"golift/cnfg","owner":"golift","description":"Procedures for parsing configs files and environment variables.","archived":false,"fork":false,"pushed_at":"2025-11-20T17:41:42.000Z","size":117,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-09T11:47:25.250Z","etag":null,"topics":["docker-library","environment-variables","go-config","go-env","go-library","golang","golang-library","golang-module"],"latest_commit_sha":null,"homepage":"https://golift.io/discord","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/golift.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-12-14T23:46:03.000Z","updated_at":"2024-07-03T07:03:49.000Z","dependencies_parsed_at":"2024-01-21T22:52:07.786Z","dependency_job_id":"5c709f81-f8b1-4456-8267-c7fd7c0d3591","html_url":"https://github.com/golift/cnfg","commit_stats":{"total_commits":88,"total_committers":2,"mean_commits":44.0,"dds":"0.11363636363636365","last_synced_commit":"47fb7e65181eb1f14139a171f09b967972015ee9"},"previous_names":["golift/config"],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/golift/cnfg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golift%2Fcnfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golift%2Fcnfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golift%2Fcnfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golift%2Fcnfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/golift","download_url":"https://codeload.github.com/golift/cnfg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/golift%2Fcnfg/sbom","scorecard":{"id":434844,"data":{"date":"2025-08-11","repo":{"name":"github.com/golift/cnfg","commit":"0ffe51c6ce4f4ce64cc5a1ec590b2d7fc6eb7827"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 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":"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":"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codetests.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/golift/cnfg/codetests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codetests.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/golift/cnfg/codetests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codetests.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/golift/cnfg/codetests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codetests.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/golift/cnfg/codetests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codetests.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/golift/cnfg/codetests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codetests.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/golift/cnfg/codetests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codetests.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/golift/cnfg/codetests.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/codetests.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/golift/cnfg/codetests.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction 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":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/codetests.yml:7","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":"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":"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":"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":"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":"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":"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 28 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-19T04:21:10.423Z","repository_id":46576424,"created_at":"2025-08-19T04:21:10.423Z","updated_at":"2025-08-19T04:21:10.423Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29537072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T05:00:25.817Z","status":"ssl_error","status_checked_at":"2026-02-17T04:57:16.126Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["docker-library","environment-variables","go-config","go-env","go-library","golang","golang-library","golang-module"],"created_at":"2025-03-12T02:27:05.181Z","updated_at":"2026-02-17T07:57:32.168Z","avatar_url":"https://github.com/golift.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# golift.io/cnfg\n\n[![Go Report Card](https://goreportcard.com/badge/golift.io/cnfg)](https://goreportcard.com/report/golift.io/cnfg)\n\n## Overview\n\nProcedures for parsing config files and environment variables into data structures.\nWorks much like `json.Unmarshal` and `json.Marshal`.\nShort explanation on how the env variable mapping works below.\nSee [GoDoc](https://pkg.go.dev/golift.io/cnfg) for several working examples and\nfurther explanation of how maps and slices can be accessed with shell env vars.\n\n**Supports all base types**, including slices, maps, slices of maps, maps of slices,\npointers of slices to maps of slices full of ints, strings, floats and the like!\n\nPlease open an issue if you run into a bug or an unsupported type.\n\nBetter documentation is needed. Most of it is in [GoDoc](https://pkg.go.dev/golift.io/cnfg).\nThis package is **full featured** for environment variable parsing!\n\nBonus, it goes the other way too. You can convert a data structure into environment variables.\nThis is useful when you wish to pass a lot of data into a command via exec.Command.\nSimply set the data into a struct, marshal it into environment variables and pass it in.\n\n## Examples\n\n```\ntype Shelter struct {\n\tTitle  string    `xml:\"title\"`\n\tSym    float64   `xml:\"sym\"`\n\tPeople []*Person `xml:\"people\"`\n\tDogs   []*Dog    `xml:\"dogs\"`\n}\n\ntype Person struct {\n\tName    string `xml:\"name\"`\n\tPresent bool   `xml:\"present\"`\n\tAge     int    `xml:\"age\"`\n\tID      int64  `xml:\"id\"`\n}\n\ntype Dog struct {\n\tName    string\n\tElapsed config.Duration\n\tOwners  []string\n}\n\ntype Config struct {\n\t*Shelter `xml:\"shelter\"`\n}\n```\n\nThe above struct can be configured with the following environment variables,\nassuming you set `prefix := \"APP\"` when you call `UnmarshalENV()`. Slices use env\nvars with numbers in them, starting at 0 and going to infinity, or the last env\nvar provided + 1, whichever comes first. It just works. The `...` and `++` indicate\nthat those parameters belong to slices, and many items may be appended or overridden.\n\n```\nAPP_SHELTER_TITLE\nAPP_SHELTER_SYM\nAPP_SHELTER_PEOPLE_0_NAME\nAPP_SHELTER_PEOPLE_0_PRESENT\nAPP_SHELTER_PEOPLE_0_AGE\nAPP_SHELTER_PEOPLE_0_ID\nAPP_SHELTER_PEOPLE_1_NAME\n...\nAPP_SHELTER_PEOPLE_10_ID ++\n\nAPP_SHELTER_DOGS_0_NAME\nAPP_SHELTER_DOGS_0_ELAPSED\nAPP_SHELTER_DOGS_0_OWNERS_0\n...\nAPP_SHELTER_DOGS_0_OWNERS_10 ++\n\nAPP_SHELTER_DOGS_1_NAME\nAPP_SHELTER_DOGS_1_ELAPSED\nAPP_SHELTER_DOGS_1_OWNERS_0\nAPP_SHELTER_DOGS_1_OWNERS_1 ++\n```\n\nIf you passed in the `Shelter` struct instead of `Config`, all the of the `SHELTER_`\nportions of the tags would be omitted. You can also set which struct tag to use by\ncreating an `\u0026ENV{}` pointer and setting `Tag` and/or `Pfx` . `Tag` defaults to\n`\"xml\"`, but you could set it to `\"env\"` and make custom names for env variables.\nThe env var prefix `Pfx` is optional, but recommended.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolift%2Fcnfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgolift%2Fcnfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgolift%2Fcnfg/lists"}