asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
6.05k stars 555 forks source link

Add an ISO3166 special case for Kosovo #447

Open sam-w opened 3 years ago

sam-w commented 3 years ago
Q A
Documentation no
Bugfix yes
BC Break no
New Feature no
RFC no
QA no

Description

Adds a special case for the IsISO3166Alpha2 and IsISO3166Alpha3 validators for Kosovo.

Kosovo declared independence in 2008, but we're still waiting for an official inclusion to the ISO3166 standard. In the meantime many official bodies have begun using the codes XK and XXK. An example of the prevalence of this unofficial usage is that that iOS lists XK as one of its locale codes.

Expected: IsISO3166Alpha2("XK") returns true Actual: false

sergeyglazyrindev commented 3 years ago

Hello guys! I forked this package cause owner disappeared. Hope, he will be back, but it would be easier to merge these changes back if he is back Link to my repo: create issue there and we'll discuss it.