{"id":20010336,"url":"https://github.com/fifsky/goconf","last_synced_at":"2026-06-11T10:31:32.487Z","repository":{"id":57486829,"uuid":"135403389","full_name":"fifsky/goconf","owner":"fifsky","description":"Gjson-based configuration file","archived":false,"fork":false,"pushed_at":"2019-01-17T02:24:26.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-02T01:45:26.811Z","etag":null,"topics":["go"],"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/fifsky.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":"2018-05-30T07:14:01.000Z","updated_at":"2018-10-10T01:56:34.000Z","dependencies_parsed_at":"2022-09-01T22:51:07.236Z","dependency_job_id":null,"html_url":"https://github.com/fifsky/goconf","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fifsky/goconf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fgoconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fgoconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fgoconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fgoconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fifsky","download_url":"https://codeload.github.com/fifsky/goconf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fifsky%2Fgoconf/sbom","scorecard":{"id":399167,"data":{"date":"2025-08-11","repo":{"name":"github.com/fifsky/goconf","commit":"15ec8bb19092d120d853e4b36e99b2f3e2ed58a8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/29 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":"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":"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":"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":"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":"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":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2021-0059 / GHSA-w942-gw6m-p62c","Warn: Project is vulnerable to: GO-2022-0957 / GHSA-wjm3-fq3r-5x46","Warn: Project is vulnerable to: GO-2021-0054 / GHSA-p64j-r5f4-pwwx","Warn: Project is vulnerable to: GO-2021-0265 / GHSA-ppj4-34rq-v8j9"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T19:43:34.661Z","repository_id":57486829,"created_at":"2025-08-18T19:43:34.662Z","updated_at":"2025-08-18T19:43:34.662Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34195112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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":["go"],"created_at":"2024-11-13T07:19:21.281Z","updated_at":"2026-06-11T10:31:32.463Z","avatar_url":"https://github.com/fifsky.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg\n    src=\"logo.png\"\n    width=\"240\" height=\"78\" border=\"0\" alt=\"GJSON\"\u003e\n\u003cbr\u003e\n\u003ca href=\"https://travis-ci.org/fifsky/goconf\"\u003e\u003cimg src=\"https://travis-ci.org/fifsky/goconf.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/fifsky/goconf\"\u003e\u003cimg src=\"https://codecov.io/gh/fifsky/goconf/branch/master/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/fifsky/goconf\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/fifsky/goconf\" alt=\"Go Report Card\n\"\u003e\u003c/a\u003e\n\u003ca href=\"https://godoc.org/github.com/fifsky/goconf\"\u003e\u003cimg src=\"https://godoc.org/github.com/fifsky/goconf?status.svg\" alt=\"GoDoc\"\u003e\u003c/a\u003e\n\u003ca href=\"https://opensource.org/licenses/mit-license.php\" rel=\"nofollow\"\u003e\u003cimg src=\"https://badges.frapsoft.com/os/mit/mit.svg?v=103\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eGjson-based configuration file for golang\u003c/a\u003e\u003c/p\u003e\n\nGoConf is a Go package that quickly retrieves JSON configuration files based on [GJSON](https://github.com/tidwall/gjson/)\n\nGetting Started\n===============\n\n## Installing\n\nTo start using GoConf, install Go and run `go get`:\n\n```sh\n$ go get -u github.com/fifsky/goconf\n```\n\nThis will retrieve the library.\n\n\n## Load multiple configs\n\nYou only need to declare the Tag `conf:\"filename\"` on the struct\n\n```\ntype log struct {\n    LogName string `json:\"log_name\"`\n    LogPath string `json:\"log_path\"`\n}\n\ntype db struct {\n    Name string `json:\"name\"`\n    Host string `json:\"host\"`\n    Port string `json:\"port\"`\n}\n\ntype config struct {\n    Log log `conf:\"log\"`\n    DB  db  `conf:\"db\"`\n}\n\nconf, err := NewConfig(\"./testdata/\")\nif err != nil {\n    fmt.Fatal(err)\n}\n\napp := \u0026config{}\nerr = conf.Load(app)\n\nfmt.Printf(\"%#v\",app)\n```\n\n\n## Get config a value\n\nConfig file: testdata/dev.json\n\n```\n{\n  \"name\": {\"first\": \"Tom\", \"last\": \"Anderson\"},\n  \"age\":37,\n  \"children\": [\"Sara\",\"Alex\",\"Jack\"],\n  \"fav.movie\": \"Deer Hunter\",\n  \"friends\": [\n    {\"first\": \"Dale\", \"last\": \"Murphy\", \"age\": 44},\n    {\"first\": \"Roger\", \"last\": \"Craig\", \"age\": 68},\n    {\"first\": \"Jane\", \"last\": \"Murphy\", \"age\": 47}\n  ]\n}\n```\n\n\n```go\npackage main\n\nimport \"github.com/fifsky/goconf\"\n\nfunc main() {\n    conf, _ := goconf.NewConfig(\"./testdata/\")\n    ret, _ := conf.Get(\"dev.name.last\")\n\n    println(ret.String())\n}\n```\n\nThis will print:\n\n```\nAnderson\n```\n\nYou can also use the Must function to simplify this\n\n```go\npackage main\n\nimport \"github.com/fifsky/goconf\"\n\nfunc main() {\n    conf, _ := goconf.NewConfig(\"./testdata/\")\n    println(conf.MustGet(\"dev.name.last\").String())\n}\n```\n\n\n\u003e first key `dev` is filename\n\n## Path Syntax\nFor more Path Syntax, see the [GJSON document](https://github.com/tidwall/gjson/blob/master/README.md#path-syntax)\n\n## Default value\nIf you use the Must function to access a non-existent configuration file or keys, GoConf returns zero value, which is consistent with gjson.result\n\n```go\nconf.MustGet(\"dev.notfound\").String() //value is empty string\nconf.MustGet(\"dev2.not\").Int() //value is 0 int\n```\n\n## Unmarshal to Struct\n```go\ntype Database struct {\n\tDriver string `json:\"driver\"`\n\tHost   string `json:\"host\"`\n\tPort   int    `json:\"port\"`\n}\n\ntype ConfigDemo struct {\n\tDatabase Database `json:\"database\"`\n}\n\nconf, _ := goconf.NewConfig(\"./testdata/\")\napp := \u0026ConfigDemo{}\nerr = conf.Unmarshal(\"json5\", app)\nif err != nil {\n    fmt.Println(err)\n}\nfmt.Println(app)\n//\u0026{{mysql localhost 3306}}\n```\n\n`Unmarshal` also supports Xpath\n\n```go\ndatabase := \u0026Database{}\nconf.Unmarshl(\"json5.database\",database)\n```\n\n\n## Contact\nXudong Cai [@fifsky](https://fifsky.com/)\n\n## License\n\nGoConf source code is available under the MIT [License](/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffifsky%2Fgoconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffifsky%2Fgoconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffifsky%2Fgoconf/lists"}