Skip to content

Commit 14403b7

Browse files
author
Dongri Jin
authored
Merge pull request #36 from clerkinc/support-swaziland
Add support for Eswatini/Swaziland phone numbers
2 parents 890ca11 + d963996 commit 14403b7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

iso3166.go

+8
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,14 @@ func populateISO3166() {
16201620
i.PhoneNumberLengths = []int{7}
16211621
iso3166Datas = append(iso3166Datas, i)
16221622

1623+
i.Alpha2 = "SZ"
1624+
i.Alpha3 = "SWZ"
1625+
i.CountryCode = "268"
1626+
i.CountryName = "Swaziland"
1627+
i.MobileBeginWith = []string{"7"}
1628+
i.PhoneNumberLengths = []int{8}
1629+
iso3166Datas = append(iso3166Datas, i)
1630+
16231631
i.Alpha2 = "SY"
16241632
i.Alpha3 = "SYR"
16251633
i.CountryCode = "963"

phonenumber_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var mobWithLLCountryTests = []struct {
2020
{"5117061970", "PE"},
2121
{"862185551232", "CN"},
2222
{"38391234999", "XK"},
23+
{"26822123456", "SZ"},
2324

2425
// Mobile numbers
2526
{"39339638066", "IT"},
@@ -30,6 +31,7 @@ var mobWithLLCountryTests = []struct {
3031
{"51999400500", "PE"},
3132
{"8614855512329", "CN"},
3233
{"38342224999", "XK"},
34+
{"26876123456", "SZ"},
3335
}
3436

3537
func TestGetCountryForMobileNumberWithLandLine(t *testing.T) {

0 commit comments

Comments
 (0)