Skip to content

Commit

Permalink
Merge pull request #36 from clerkinc/support-swaziland
Browse files Browse the repository at this point in the history
Add support for Eswatini/Swaziland phone numbers
  • Loading branch information
Dongri Jin authored Nov 1, 2023
2 parents 890ca11 + d963996 commit 14403b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions iso3166.go
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,14 @@ func populateISO3166() {
i.PhoneNumberLengths = []int{7}
iso3166Datas = append(iso3166Datas, i)

i.Alpha2 = "SZ"
i.Alpha3 = "SWZ"
i.CountryCode = "268"
i.CountryName = "Swaziland"
i.MobileBeginWith = []string{"7"}
i.PhoneNumberLengths = []int{8}
iso3166Datas = append(iso3166Datas, i)

i.Alpha2 = "SY"
i.Alpha3 = "SYR"
i.CountryCode = "963"
Expand Down
2 changes: 2 additions & 0 deletions phonenumber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var mobWithLLCountryTests = []struct {
{"5117061970", "PE"},
{"862185551232", "CN"},
{"38391234999", "XK"},
{"26822123456", "SZ"},

// Mobile numbers
{"39339638066", "IT"},
Expand All @@ -30,6 +31,7 @@ var mobWithLLCountryTests = []struct {
{"51999400500", "PE"},
{"8614855512329", "CN"},
{"38342224999", "XK"},
{"26876123456", "SZ"},
}

func TestGetCountryForMobileNumberWithLandLine(t *testing.T) {
Expand Down

0 comments on commit 14403b7

Please sign in to comment.