{"id":13621364,"url":"https://github.com/unknwon/goconfig","last_synced_at":"2025-05-14T15:00:27.093Z","repository":{"id":7407064,"uuid":"8737824","full_name":"unknwon/goconfig","owner":"unknwon","description":"Package goconfig is a fully functional and comments-support configuration file (.ini) parser.","archived":false,"fork":false,"pushed_at":"2024-09-01T02:09:29.000Z","size":150,"stargazers_count":607,"open_issues_count":1,"forks_count":145,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-09T11:01:56.272Z","etag":null,"topics":["configuration","go","ini","parser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"openaddresses/openaddresses","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unknwon.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}},"created_at":"2013-03-12T20:35:38.000Z","updated_at":"2025-02-11T11:47:42.000Z","dependencies_parsed_at":"2024-10-22T07:59:36.379Z","dependency_job_id":null,"html_url":"https://github.com/unknwon/goconfig","commit_stats":{"total_commits":100,"total_committers":14,"mean_commits":7.142857142857143,"dds":0.24,"last_synced_commit":"395636219ef6f49f2f1006977fedc52190b1209f"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgoconfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgoconfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgoconfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unknwon%2Fgoconfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unknwon","download_url":"https://codeload.github.com/unknwon/goconfig/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254168125,"owners_count":22026090,"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","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","go","ini","parser"],"created_at":"2024-08-01T21:01:05.160Z","updated_at":"2025-05-14T15:00:27.028Z","avatar_url":"https://github.com/unknwon.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"goconfig \n========\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/sourcegraph/sourcegraph-accounts-sdk-go.svg)](https://pkg.go.dev/github.com/sourcegraph/sourcegraph-accounts-sdk-go)\n\n[中文文档](README_ZH.md)\n\n**IMPORTANT** \n\n- This library is under bug fix only mode, which means no more features will be added.\n- I'm continuing working on better Go code with a different library: [ini](https://github.com/go-ini/ini).\n\n## About\n\nPackage goconfig is a easy-use, comments-support configuration file parser for the Go Programming Language, which provides a structure similar to what you would find on Microsoft Windows INI files.\n\nThe configuration file consists of sections, led by a `[section]` header and followed by `name:value` or `name=value` entries. Note that leading whitespace is removed from values. The optional values can contain format strings which refer to other values in the same section, or values in a special DEFAULT section. Comments are indicated by \";\" or \"#\"; comments may begin anywhere on a single line.\n\t\n## Features\n\t\n- It simplified operation processes, easy to use and undersatnd; therefore, there are less chances to have errors. \n- It uses exactly the same way to access a configuration file as you use Windows APIs, so you don't need to change your code style.\n- It supports read recursion sections.\n- It supports auto increment of key.\n- It supports **READ** and **WRITE** configuration file with comments each section or key which all the other parsers don't support!!!!!!!\n- It supports get value through type bool, float64, int, int64 and string, methods that start with \"Must\" means ignore errors and get zero-value if error occurs, or you can specify a default value.\n- It's able to load multiple files to overwrite key values. \n\n## Installation\n\t\n\tgo get github.com/unknwon/goconfig\n\n## Example\n\nPlease see [conf.ini](testdata/conf.ini) as an example.\n\n### Usage\n\n- Function `LoadConfigFile` load file(s) depends on your situation, and return a variable with type `ConfigFile`.\n- `GetValue` gives basic functionality of getting a value of given section and key.\n- Methods like `Bool`, `Int`, `Int64` return corresponding type of values.\n- Methods start with `Must` return corresponding type of values and returns zero-value of given type if something goes wrong.\n- `SetValue` sets value to given section and key, and inserts somewhere if it does not exist.\n- `DeleteKey` deletes by given section and key.\n- Finally, `SaveConfigFile` saves your configuration to local file system.\n- Use method `Reload` in case someone else modified your file(s).\n- Methods contains `Comment` help you manipulate comments.\n- `LoadFromReader` allows loading data without an intermediate file.\n- `SaveConfigData` added, which writes configuration to an arbitrary writer.\n- `ReloadData` allows to reload data from memory.\n\nNote that you cannot mix in-memory configuration with on-disk configuration.\n\n## More Information\n\n- All characters are CASE SENSITIVE, BE CAREFUL!\n\n## Credits\n\n- [goconf](http://code.google.com/p/goconf/)\n- [robfig/config](https://github.com/robfig/config)\n- [Delete an item from a slice](https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/lYz8ftASMQ0)\n\n## License\n\nThis project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funknwon%2Fgoconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funknwon%2Fgoconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funknwon%2Fgoconfig/lists"}