{"id":34221438,"url":"https://github.com/timestee/goconf","last_synced_at":"2026-04-11T05:03:07.401Z","repository":{"id":56101996,"uuid":"89578472","full_name":"timestee/goconf","owner":"timestee","description":"Configuration loader in Go","archived":false,"fork":false,"pushed_at":"2023-03-09T12:14:08.000Z","size":55,"stargazers_count":24,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-01-14T14:00:53.679Z","etag":null,"topics":["command-line","config","configuration-files","configuration-loader","flag","go","goconf","golang","json","toml"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timestee.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}},"created_at":"2017-04-27T09:08:18.000Z","updated_at":"2023-12-01T19:34:17.000Z","dependencies_parsed_at":"2023-07-15T13:22:58.005Z","dependency_job_id":null,"html_url":"https://github.com/timestee/goconf","commit_stats":null,"previous_names":["zsounder/goconf"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/timestee/goconf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timestee%2Fgoconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timestee%2Fgoconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timestee%2Fgoconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timestee%2Fgoconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timestee","download_url":"https://codeload.github.com/timestee/goconf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timestee%2Fgoconf/sbom","scorecard":{"id":885878,"data":{"date":"2025-08-11","repo":{"name":"github.com/timestee/goconf","commit":"0adfaefc5a9674dd8c2adc7a0d67d6820cd15630"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"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":"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":"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":"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":"Code-Review","score":2,"reason":"Found 5/25 approved changesets -- score normalized to 2","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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: The Unlicense: 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":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 10 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-24T10:01:29.597Z","repository_id":56101996,"created_at":"2025-08-24T10:01:29.598Z","updated_at":"2025-08-24T10:01:29.598Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31669117,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"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":["command-line","config","configuration-files","configuration-loader","flag","go","goconf","golang","json","toml"],"created_at":"2025-12-15T23:14:25.828Z","updated_at":"2026-04-11T05:03:07.396Z","avatar_url":"https://github.com/timestee.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Archived] This repository has been archived,See https://github.com/sandwich-go/xconf instead.\n\n# goconf \n[![Build Status](https://travis-ci.org/timestee/goconf.svg?branch=master)](https://travis-ci.org/timestee/goconf)\n[![Go Walker](https://gowalker.org/api/v1/badge)](https://gowalker.org/github.com/timestee/goconf)\n[![GoDoc](https://godoc.org/github.com/timestee/goconf?status.svg)](https://godoc.org/github.com/timestee/goconf)\n[![Go Report Card](https://goreportcard.com/badge/github.com/timestee/goconf)](https://goreportcard.com/report/github.com/timestee/goconf)[![Sourcegraph](https://sourcegraph.com/github.com/timestee/goconf/-/badge.svg)](https://sourcegraph.com/github.com/timestee/goconf?badge)\n## Overview\n\n* Read configuration automatically based on the given struct's field name.\n* Load configuration from multiple sources\n* file inherit\n\nValues are resolved with the following priorities (lowest to highest):\n1. Options struct default value\n2. Flags default value\n3. Config file value, TOML or JSON file\n4. OS Env\n5. Command line flag\n\n## About field tags in structs\n```go\ntype TestOptions struct {\n    Hosts []string `flag:\"hosts\" cfg:\"hosts\" default:\"127.0.0.0,127.0.0.1\"`\n}\n```\n* `flag` is the name passed from the command line.\n* `cfg` is the name used in config files.\n* `default` is the default value\n\nIf do not define `flag` tag, `flag` will be snake case of the fild name.\n\nIf do not define `cfg` tag, `cfg` value will be `flag` value.\n\nFor example, flag and cfg will be http_address.\n```go\n  HTTPAddress string\n```\n\n## Usage\n\n### load multiple config files\n\n```go\npackage main\n\nimport \"github.com/timestee/goconf\"\n\ntype TestOptions struct {\n    goconf.AutoOptions\n    HTTPAddress string `default:\"0.0.0.0:0000\"`\n    Hosts []string `flag:\"hosts\" cfg:\"hosts\" default:\"127.0.0.0,127.0.0.1\"`\n    LogLevel int `default:\"3\"`\n    BoolVar bool `default:\"false\"`\n}\n\nfunc main() {\n   ops := \u0026TestOptions{}\n   goconf.MustResolve(ops,\"conf_1.toml\",\"conf_2.toml\")\n}\n```\n\n`go run main.go --log_level=1`\n\nThe output will be:\n\n```plain\n[Config] auto flag succ, name: _auto_conf_files_ val:\n[Config] auto flag succ, name: http_address val: 0.0.0.0:0000\n[Config] auto flag fail, name: hosts val: 127.0.0.0,127.0.0.1 err: type not support []string\n[Config] auto flag succ, name: log_level val: 3\n[Config] auto flag succ, name: bool_var val: false\n[Config] file: [conf_1.toml conf_2.toml]\n[Config] load: conf_1.toml\n[Config] load: conf_2.toml\n[Config]\n{\n   \"AutoConfFiles\": \"\",\n   \"HTTPAddress\": \"127.0.0.1:2\",\n   \"Hosts\": [\n      \"10.0.61.29\",\n      \"10.0.61.30\",\n      \"10.0.61.31\",\n      \"10.0.61.32\"\n   ],\n   \"LogLevel\": 1,\n   \"BoolVar\": true\n}\n```\n\n### load config file with file inherited\n\n```go\npackage main\n\nimport \"github.com/timestee/goconf\"\n\ntype TestOptions struct {\n    goconf.AutoOptions\n    HTTPAddress string `default:\"0.0.0.0:0000\"`\n    Hosts []string `flag:\"hosts\" cfg:\"hosts\" default:\"127.0.0.0,127.0.0.1\"`\n    LogLevel int `default:\"3\"`\n    BoolVar bool `default:\"false\"`\n}\n\nfunc main() {\n   ops := \u0026TestOptions{}\n   // conf_3 inherit from conf_1 and conf_2\n   goconf.MustResolve(ops,\"conf_3.toml\")\n}\n```\n`go run main.go --http_address=0.0.0.0:1111111`\n\nThe output will be:\n\n```plain\n[Config] auto flag succ, name: _auto_conf_files_ val:\n[Config] auto flag succ, name: http_address val: 0.0.0.0:0000\n[Config] auto flag fail, name: hosts val: 127.0.0.0,127.0.0.1 err: type not support []string\n[Config] auto flag succ, name: log_level val: 3\n[Config] auto flag succ, name: bool_var val: false\n[Config] file: [conf_3.toml]\n[Config] load: ./conf_1.toml\n[Config] load: ./conf_2.toml\n[Config] load: conf_3.toml\n[Config]\n{\n   \"AutoConfFiles\": \"\",\n   \"HTTPAddress\": \"0.0.0.0:1111111\",\n   \"Hosts\": [\n      \"10.0.61.29\",\n      \"10.0.61.30\",\n      \"10.0.61.31\",\n      \"10.0.61.32\",\n      \"10.0.61.33\"\n   ],\n   \"LogLevel\": 2,\n   \"BoolVar\": true\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimestee%2Fgoconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimestee%2Fgoconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimestee%2Fgoconf/lists"}