{"id":13786678,"url":"https://github.com/mikekonan/go-types","last_synced_at":"2026-01-28T11:14:40.556Z","repository":{"id":37977069,"uuid":"360145760","full_name":"mikekonan/go-types","owner":"mikekonan","description":"Library providing opanapi3 and Go types for store/validation and transfer of ISO-4217, ISO-3166, and other types.","archived":false,"fork":false,"pushed_at":"2025-09-12T14:49:53.000Z","size":273,"stargazers_count":22,"open_issues_count":1,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T15:58:18.637Z","etag":null,"topics":["country-codes","currency-codes","email","go-validator","iso-3166","iso-3166-2","iso-4217","openapi3","url"],"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-21T11:34:25.000Z","updated_at":"2025-09-12T14:49:41.000Z","dependencies_parsed_at":"2024-07-26T22:00:24.738Z","dependency_job_id":"fd7cf362-11ae-45e6-975a-9b59d502ec0f","html_url":"https://github.com/mikekonan/go-types","commit_stats":null,"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/mikekonan/go-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikekonan","download_url":"https://codeload.github.com/mikekonan/go-types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikekonan%2Fgo-types/sbom","scorecard":{"id":645621,"data":{"date":"2025-08-11","repo":{"name":"github.com/mikekonan/go-types","commit":"a2fcaaa276ebfb933f38ffe6ed87fb6ecaf27d4e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Code-Review","score":7,"reason":"Found 22/30 approved changesets -- score normalized to 7","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":"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":"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":"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":"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":"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":"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 25 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":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc"],"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:42.776Z","repository_id":37977069,"created_at":"2025-08-21T12:04:42.776Z","updated_at":"2025-08-21T12:04:42.776Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844821,"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":["country-codes","currency-codes","email","go-validator","iso-3166","iso-3166-2","iso-4217","openapi3","url"],"created_at":"2024-08-03T19:01:28.056Z","updated_at":"2026-01-28T11:14:40.540Z","avatar_url":"https://github.com/mikekonan.png","language":"Go","funding_links":[],"categories":["公用事业公司","Utilities","Utility"],"sub_categories":["实用程序/Miscellaneous","Utility/Miscellaneous","Fail injection","HTTP Clients"],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/mikekonan/go-types)](https://goreportcard.com/report/github.com/mikekonan/go-types) [![Build Status](https://travis-ci.com/mikekonan/go-types.svg?branch=main)](https://travis-ci.com/mikekonan/go-types) [![codecov](https://codecov.io/gh/mikekonan/go-types/branch/main/graph/badge.svg?token=83Q04OW4I1)](https://codecov.io/gh/mikekonan/go-types)\n# go-types\nThis library has been created with the purpose to facilitate the store, validation, and transfer of Go ISO-3166/ISO-4217/timezones/emails/URL types. There is a [openapi3 spec](https://github.com/mikekonan/go-types/blob/main/swagger.yaml) of that type and make you able to include it into your spec. All types has own ozzo.Validate, json.Unmarshaler, Stringer and driver.Valuer implementations.\n\n# Installation\n```bash\ngo get github.com/mikekonan/go-types/v2\n```\n# Usage:\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\tvalidation \"github.com/go-ozzo/ozzo-validation/v4\"\n\t\"github.com/mikekonan/go-types/v2/country\"\n\t\"github.com/mikekonan/go-types/v2/country/alpha2\"\n\t\"github.com/mikekonan/go-types/v2/country/alpha3\"\n\t\"github.com/mikekonan/go-types/v2/language\"\n\t\"github.com/mikekonan/go-types/v2/country/name\"\n\t\"github.com/mikekonan/go-types/v2/currency\"\n\t\"github.com/mikekonan/go-types/v2/currency/code\"\n\t\"github.com/mikekonan/go-types/v2/phone\"\n\t\"github.com/mikekonan/go-types/v2/postal_code\"\n)\n\n// 1. use in your structs\ntype User struct {\n\tName            string                `json:\"name\" db:\"name\"`\n\tCountry         country.Alpha2Code    `json:\"country\" db:\"country\"`\n\tCurrency        currency.Code         `json:\"currency\" db:\"currency\"`\n\tLanguage        language.Alpha2Code   `json:\"language\" db:\"language\"`\n\tPhone           phone.Number          `json:\"phone\" db:\"phone\"`\n\tCountryDialCode phone.DialCode        `json:\"dialCode\" db:\"dialCode\"`\n\tPostalCode      postalcode.PostalCode `json:\"postalCode\" db:\"postalCode\"`\n}\n\nfunc main() {\n\t// 2. use in your wire\n\tuser := User{}\n\t_ = json.Unmarshal([]byte(`{\"name\":\"name\", \"country\": \"CA\", \"currency\": \"CAD\", \"language\": \"fr\", \"phone\": \"123456789\", \"dialCode\": \"1\"}`), \u0026user)\n\n\t// 3. check is set\n\tuser.Country.IsSet()\n\tuser.Currency.IsSet()\n\tuser.Language.IsSet()\n\n\t// 4. validate using ozzo-validation\n\tif err := validation.ValidateStruct(\u0026user, validation.Field(\u0026user.Country), validation.Field(\u0026user.Currency)); err != nil {\n            log.Fatal(err)\n\t}\n\n\t// 5. lookup by alpha2, alpha3, country name\n\tif userCountry, ok := country.ByAlpha2Code(user.Country); ok {\n            fmt.Printf(\"country name - '%s', alpha-2 - '%s', alpha-3 - '%s'\", userCountry.Name(), userCountry.Alpha2Code(), userCountry.Alpha3Code())\n\t}\n\n\t// 6. lookup by 2 and 3 char codes, language name\n\tif userLanguage, ok := language.ByAlpha2Code(user.Language); ok {\n            fmt.Printf(\"language name - '%s', alpha-2 - '%s', alpha-3 - '%s'\", userLanguage.Name(), userLanguage.Alpha2Code(), userLanguage.Alpha3Code())\n\t}\n\n\t// 7. lookup by country dial code\n\tif phoneCountries, ok := phone.CountriesByDialCode(user.CountryDialCode); ok {\n            for _, phoneCountry := range phoneCountries {\n                fmt.Printf(\"country by dial code - '%s'\", phoneCountry)\n            }\n\t}\n\n\t// 8. lookup by country\n\tif dialCode, ok := phone.DialByAlpha2Code(user.Country); ok {\n            fmt.Printf(\"'%s' dial code is '%s'\", user.Country, dialCode)\n        }\n\n\t// 9. lookup by currency code\n\tif userCurrency, ok := currency.ByCode(user.Currency); ok {\n            fmt.Printf(\"currency name - '%s', code - '%s', number - '%s', countries - '%s', decimal places - '%d'\",\n                userCurrency.Currency(), userCurrency.Code(), userCurrency.Number(), userCurrency.Countries(), userCurrency.DecimalPlaces())\n\t}\n\n\t// 10. store in db\n\tfmt.Println(user.Country.Value())  //prints 'CA'\n\tfmt.Println(user.Currency.Value()) //prints 'CAN'\n\tfmt.Println(user.Language.Value()) //prints 'fr'\n\n\t// 11. use specific country constants\n\tfmt.Println(country.Canada.Alpha2Code())\n\tfmt.Println(\"name:\", name.Canada)\n\tfmt.Println(\"alpha-2:\", alpha2.CA)\n\tfmt.Println(\"alpha-3:\", alpha3.CAN)\n\n\t// 12. use specific currency codes\n\tfmt.Println(code.CAD)\n}\n```\n\n## Links:\n- Currency Codes [(ISO 4217)](https://www.currency-iso.org/en/home/tables/table-a1.html) - [wiki](https://en.wikipedia.org/wiki/ISO_4217), [data source](https://www.six-group.com/dam/download/financial-information/data-center/iso-currrency/lists/list-one.xml)\n- Country Codes [(ISO 3166)](https://www.iso.org/iso-3166-country-codes.html) - [wiki](https://en.wikipedia.org/wiki/ISO_3166-2)\n- URL(including HttpURL) [(standard)](https://url.spec.whatwg.org/) - [wiki](https://en.wikipedia.org/wiki/URL)\n- Email [(part of RFC5322)](https://tools.ietf.org/html/rfc5322) - [wiki](https://en.wikipedia.org/wiki/Email_address)\n- Timezone [(RFC6557 IANA timezones)](https://www.iana.org/time-zones) - [wiki](https://en.wikipedia.org/wiki/Time_zone)\n- Languages [(ISO 639-1)](https://www.iso.org/standard/22109.html) - [wiki](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes); [(ISO 639-2)](https://www.iso.org/standard/4767.html) - [wiki](https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes), [data source](https://datahub.io/core/language-codes/r/language-codes-3b2.json)\n- Dial Codes [(E.164)](https://www.itu.int/rec/T-REC-E.164-201203-I!Sup6/en) - [wiki](https://en.wikipedia.org/wiki/E.164), [data source](https://datahub.io/core/country-codes/r/country-codes.json)\n- BCP47 language tags [(wiki)](https://en.wikipedia.org/wiki/IETF_language_tag), [rfc](https://www.rfc-editor.org/info/bcp47)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikekonan%2Fgo-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikekonan%2Fgo-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikekonan%2Fgo-types/lists"}