{"id":34122899,"url":"https://github.com/dns-gh/flagsconfig","last_synced_at":"2026-04-22T06:06:45.973Z","repository":{"id":57519139,"uuid":"73297470","full_name":"dns-gh/flagsconfig","owner":"dns-gh","description":"Improved configuration management using a configuration file for user defined flags and used flags at runtime.","archived":false,"fork":false,"pushed_at":"2016-11-09T16:37:05.000Z","size":2,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-17T07:55:20.691Z","etag":null,"topics":["configuration","flags","json"],"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/dns-gh.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":"2016-11-09T15:43:07.000Z","updated_at":"2017-08-31T21:44:43.000Z","dependencies_parsed_at":"2022-09-06T05:10:29.786Z","dependency_job_id":null,"html_url":"https://github.com/dns-gh/flagsconfig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dns-gh/flagsconfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dns-gh%2Fflagsconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dns-gh%2Fflagsconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dns-gh%2Fflagsconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dns-gh%2Fflagsconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dns-gh","download_url":"https://codeload.github.com/dns-gh/flagsconfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dns-gh%2Fflagsconfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32123605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"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":["configuration","flags","json"],"created_at":"2025-12-14T22:02:27.978Z","updated_at":"2026-04-22T06:06:45.943Z","avatar_url":"https://github.com/dns-gh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## flagsconfig package\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/dns-gh/flagsconfig)](https://goreportcard.com/report/github.com/dns-gh/flagsconfig)\n\n[![GoDoc](https://godoc.org/github.com/dns-gh/flagsconfig?status.png)]\n(https://godoc.org/github.com/dns-gh/flagsconfig)\n\nImproved configuration management using a configuration file for user defined flags and used flags at runtime.\n\n## Motivation\n\nTo get a more clean and simple way to play with configuration files.\n\n## Installation\n\n- It requires Go language of course. You can set it up by downloading it here: https://golang.org/dl/\n- Install it here C:/Go.\n- Set your GOPATH, GOROOT and PATH environment variables:\n\n```\nexport GOROOT=C:/Go\nexport GOPATH=WORKING_DIR\nexport PATH=C:/Go/bin:${PATH}\n```\n\n- Download and install the package:\n\n```\n@working_dir $ go get github.com/dns-gh/flagsconfig/...\n@working_dir $ go install github.com/dns-gh/flagsconfig\n```\n\n## Example\n\nFile: testConfig.go\n```\npackage main\n\nimport (\n\t\"flag\"\n\t\"github.com/dns-gh/flagsconfig\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tfilename := \"test.config\"\n\tfirstFlag := flag.String(\"first\", \"firstDefault\", \"first user defined flag\")\n\totherFlag := flag.String(\"other\", \"otherDefault\", \"another user defined flag\")\n\n\t// Makes the configuration structure with one filtered flag being the config flag\n\t// Hence, it will not be saved in the configuration file.\n\t// And parses the user defined flags and the one used by the user at runtime.\n\t// If the 'first' flag was used at runtime, the value of this flag will be\n\t// the one saved into the config file instead of the default one.\n\t_, err := flagsconfig.NewConfig(filename, \"other\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"filename:\", filename)\n\tfmt.Println(\"first:\", *firstFlag)\n\tfmt.Println(\"other:\", *otherFlag)\n}\n```\n\nSo with\n```\n$ bin/testConfig.exe\n```\n\nwe get the following output\n\n```\nfilename: test.config\nfirst: firstDefault\nother: otherDefault\n```\n\nand the configuration file looks like:\n\n```\n{\n    \"first\": \"firstDefault\"\n}\n```\n\nbut with\n```\n$ bin/testConfig.exe -first \"alice\"\n```\n\nwe get the following output\n\n```\nfilename: test.config\nfirst: alice\nother: otherDefault\n```\n\nand the configuration file looks like:\n\n```\n{\n    \"first\": \"alice\"\n}\n```\n\nif we run one more time\n```\n$ bin/testConfig.exe\n```\n\nwe get\n```\nfilename: test.config\nfirst: alice\nother: otherDefault\n```\n\nand the configuration file looks like:\n\n```\n{\n    \"first\": \"alice\"\n}\n```\nsince the 'first' flag was not defined, the previous value contained in the config file was used.\n\n## Tests\n\n```\n@gotools $ go test -v github.com/dns-gh/flagsconfig\n=== RUN   TestFlagsConfig\n--- PASS: TestFlagsConfig (0.00s)\n=== RUN   TestFlagsConfigFiltered\n--- PASS: TestFlagsConfigFiltered (0.00s)\nPASS\nok      flagsconfig     0.058s\n```\n\n## LICENSE\n\nSee included LICENSE file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdns-gh%2Fflagsconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdns-gh%2Fflagsconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdns-gh%2Fflagsconfig/lists"}