{"id":15724228,"url":"https://github.com/codeation/inifile","last_synced_at":"2025-10-21T03:30:16.919Z","repository":{"id":144423926,"uuid":"143196370","full_name":"codeation/inifile","owner":"codeation","description":"Package inifile implements parsing a simple INI file","archived":false,"fork":false,"pushed_at":"2020-08-15T10:29:30.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-12T18:48:04.840Z","etag":null,"topics":["go","golang","golang-library","ini","ini-file","ini-parser"],"latest_commit_sha":null,"homepage":"","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/codeation.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":"2018-08-01T18:58:00.000Z","updated_at":"2020-08-15T10:29:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"55cf5618-58c1-4b2f-9c88-babe5d66e089","html_url":"https://github.com/codeation/inifile","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeation%2Finifile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeation%2Finifile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeation%2Finifile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeation%2Finifile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeation","download_url":"https://codeload.github.com/codeation/inifile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237424899,"owners_count":19307980,"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":["go","golang","golang-library","ini","ini-file","ini-parser"],"created_at":"2024-10-03T22:15:37.941Z","updated_at":"2025-10-21T03:30:16.515Z","avatar_url":"https://github.com/codeation.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inifile\n\nPackage inifile implements parsing a simple INI file\n\n[![GoDoc](https://godoc.org/github.com/codeation/inifile?status.svg)](https://godoc.org/github.com/codeation/inifile)\n\n# Installation\n\nTo install inifile package:\n\n```\ngo get -u github.com/codeation/inifile\n```\n\n# Examples\n\nsample.ini file:\n\n```\nport=8080\nhost=127.0.0.1\n\n[node]\nname=server.local\nip=10.0.0.11\n```\n\nsample.go file:\n\n```\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/codeation/inifile\"\n)\n\nfunc main() {\n\tini, err := inifile.Read(\"sample.ini\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\tfmt.Println(\"port=\", ini.Get(\"\", \"port\"))\n\tfmt.Println(\"node.name=\", ini.Get(\"node\", \"name\"))\n}\n```\n\noutput:\n```\n$ go run sample.go \nport= 8080\nnode.name= server.local\n```\n\n# Environment variable\n\nYou can specify a full path to INI file via the environment variable. For example:\n\n```\n$ SAMPLE_INI=/etc/server_configuration.ini go run sample.go\n```\n\nThe environment variable is checked only if\nthe parameter of inifile.Read does not contain the directory name.\nThe name of the environment variable is the file name in uppercase,\nthe dot is replaced by an underscore.\n\n# Command output encapsulation\n\n**Please note that executing external commands can lead to application vulnerabilities.\nCommand output encapsulation is disabled by default.**\n\nYou can use command output as INI file variable value. For example, as string of INI file:\n\n```\none_time_password=$(pwgen -s 16)\n```\n\nTo enable command output encapsulation, call inifile.Command in golang file:\n\n```\n    ini, _ := inifile.Read(\"sample.ini\")\n    ini.Command(true)\n    fmt.Println(\"One time password is\", ini.Get(\"\", \"one_time_password\"))\n```\n\nSee the [documentation](https://godoc.org/github.com/codeation/inifile) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeation%2Finifile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeation%2Finifile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeation%2Finifile/lists"}