{"id":13414145,"url":"https://github.com/mikekonan/go-countries","last_synced_at":"2026-01-28T11:14:33.378Z","repository":{"id":55621431,"uuid":"307699947","full_name":"mikekonan/go-countries","owner":"mikekonan","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-17T15:41:16.000Z","size":91,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-31T20:53:33.576Z","etag":null,"topics":["iso3166-2"],"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/mikekonan.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":"2020-10-27T12:56:40.000Z","updated_at":"2023-11-19T22:45:08.000Z","dependencies_parsed_at":"2022-08-15T04:40:39.608Z","dependency_job_id":null,"html_url":"https://github.com/mikekonan/go-countries","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/mikekonan/go-countries","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-countries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-countries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-countries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-countries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikekonan","download_url":"https://codeload.github.com/mikekonan/go-countries/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-countries/sbom","scorecard":{"id":645619,"data":{"date":"2025-08-11","repo":{"name":"github.com/mikekonan/go-countries","commit":"ee810077176073b2bfaa36e1250a6b9b02987cf6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":1,"reason":"Found 2/20 approved changesets -- score normalized to 1","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":"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":"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":"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":"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":"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 'main'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 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"}},{"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"}}]},"last_synced_at":"2025-08-21T12:04:41.768Z","repository_id":55621431,"created_at":"2025-08-21T12:04:41.768Z","updated_at":"2025-08-21T12:04:41.768Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844815,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T10:53:21.605Z","status":"ssl_error","status_checked_at":"2026-01-28T10:53:20.789Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["iso3166-2"],"created_at":"2024-07-30T20:01:59.081Z","updated_at":"2026-01-28T11:14:33.363Z","avatar_url":"https://github.com/mikekonan.png","language":"Go","funding_links":[],"categories":["工具库","Utilities","公用事业公司","工具库`可以提升效率的通用代码库和工具`","Utility"],"sub_categories":["查询语","Utility/Miscellaneous","实用程序/Miscellaneous","HTTP Clients","Fail injection"],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/mikekonan/go-countries)](https://goreportcard.com/report/github.com/mikekonan/go-countries)\n# go-countries\nLightweight lookup over ISO-3166 codes. Each unit implements `driver.Valuer`, `ozzo validation.Validate`, `Stringer`, `json.Unmarshaler` interfaces. \n\nThis library has been created with the purpose to facilitate search and transfer of ISO-3166 country codes.\n\nCreated with a codegen - check generator branch.\n\n# Installation\n```go get github.com/mikekonan/go-countries```\n\n# Usage:\n\t//1. use in your structs\n\ttype User struct {\n\t\tName    string             `json:\"name\" db:\"name\"`\n\t\tCountry country.Alpha2Code `json:\"country\" db:\"country\"`\n\t}\n\n\tfunc main() {\n\t\tuser := User{}\n\t\t//2. use in your wire\n\t\tjson.Unmarshal([]byte(`{\"name\":\"name\", \"country\": \"ca\"}`), \u0026user)\n\n\t\t//3. check is set\n\t\tuser.Country.IsSet() //check user country is provided\n\n\t\t//4. validate using ozzo-validation\n\t\tif err := validation.ValidateStruct(\u0026user, validation.Field(\u0026user.Country, validation.Required, user.Country)); err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\n\t\t//5. lookup by alpha2, alpha3, country name\n\t\tif userCountry, ok := country.ByAlpha2Code(user.Country); ok {\n\t\t\tfmt.Printf(\"country name - '%s', alpha-2 - '%s', alpha-3 - '%s'\", userCountry.Name(), userCountry.Alpha2Code(), userCountry.Alpha3Code())\n\t\t}\n\n\t\t//6. store in db\n\t\tfmt.Println(user.Country.Value()) //prints 'CA'\n\n\t\t//7. use specific countries\n\t\tfmt.Println(country.Canada.Alpha2Code())\n\t}\n    \n\n# API\n### Lookup:\n    country.ByNameStrErr()\n    country.ByNameErr()\n    country.ByNameStr()\n    country.ByName()\n    \n    country.ByAlpha2CodeStrErr()\n    country.ByAlpha2CodeErr()\n    country.ByAlpha2CodeStr()\n    country.ByAlpha2Code()\n    \n    country.ByAlpha3CodeStrErr()\n    country.ByAlpha3CodeErr()\n    country.ByAlpha3CodeStr()\n    country.ByAlpha3Code()\n\n### Constants:\n    ...\n    country.Canada\n    country.Alpha2CA\n    country.Alpha3CAN\n    country.NameCanada\n    ...\n\n### Types:\n    type Country struct {\n\t    name   Name\n\t    alpha2 Alpha2Code\n\t    alpha3 Alpha3Code\n    }\n    \n    func (c Country) Name() Name             { return c.name }\n    func (c Country) Alpha2Code() Alpha2Code { return c.alpha2 }\n    func (c Country) Alpha3Code() Alpha3Code { return c.alpha3 }\n    func (c Country) NameStr() string        { return c.name.String() }\n    func (c Country) Alpha2CodeStr() string  { return c.alpha2.String() }\n    func (c Country) Alpha3CodeStr() string  { return c.alpha3.String() }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikekonan%2Fgo-countries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikekonan%2Fgo-countries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikekonan%2Fgo-countries/lists"}