Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an ISO3166 special case for Kosovo #447

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ var ISO3166List = []ISO3166Entry{
{"Kenya", "Kenya (le)", "KE", "KEN", "404"},
{"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"},
{"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"},
// Kosovo is not yet part of the ISO3166 standard, but is informally assigned the code XK/XXK in many other systems based on ISO3166
{"Kosovo", "Kosovo (le)", "XK", "XXK", "383"},
{"Kuwait", "Koweït (le)", "KW", "KWT", "414"},
{"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"},
{"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"},
Expand Down
2 changes: 2 additions & 0 deletions validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,7 @@ func TestIsISO3166Alpha2(t *testing.T) {
{"NU", true},
{"DE", true},
{"JP", true},
{"XK", true},
{"JPN", false},
{"ZWE", false},
{"GER", false},
Expand Down Expand Up @@ -1782,6 +1783,7 @@ func TestIsISO3166Alpha3(t *testing.T) {
{"NU", false},
{"DE", false},
{"JP", false},
{"XXK", true},
{"ZWE", true},
{"JPN", true},
{"GER", false},
Expand Down