Skip to content
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: 1 addition & 1 deletion examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"fmt"

"github.com/dongri/phonenumber"
"github.com/clerk/phonenumber"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not change this

)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/dongri/phonenumber
module github.com/clerk/phonenumber

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not change this


go 1.21
8 changes: 4 additions & 4 deletions iso3166.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func populateISO3166() {
i.CountryCode = "224"
i.CountryName = "Guinea"
i.MobileBeginWith = []string{"6"}
i.PhoneNumberLengths = []int{8}
i.PhoneNumberLengths = []int{8, 9}
iso3166Datas = append(iso3166Datas, i)

i.Alpha2 = "GP"
Expand Down Expand Up @@ -1135,7 +1135,7 @@ func populateISO3166() {
i.CountryCode = "95"
i.CountryName = "Myanmar"
i.MobileBeginWith = []string{"9"}
i.PhoneNumberLengths = []int{8}
i.PhoneNumberLengths = []int{8, 10, 11}
iso3166Datas = append(iso3166Datas, i)

i.Alpha2 = "ME"
Expand Down Expand Up @@ -1422,8 +1422,8 @@ func populateISO3166() {
i.Alpha3 = "PYF"
i.CountryCode = "689"
i.CountryName = "French Polynesia"
i.MobileBeginWith = []string{}
i.PhoneNumberLengths = []int{6}
i.MobileBeginWith = []string{"87", "88", "89"}
i.PhoneNumberLengths = []int{6, 8}
iso3166Datas = append(iso3166Datas, i)

i.Alpha2 = "QA"
Expand Down
9 changes: 9 additions & 0 deletions phonenumber_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ var mobFormatTests = []struct {
{"+51 912 640 074", "PE", "51912640074"},
{"+86 18 855 512 329", "CN", "8618855512329"},
{"+383 4 555 4999", "XK", "38345554999"},
{"+224629295237", "GN", "224629295237"},
{"+68989657111", "PF", "68989657111"},
{"+959452929499", "MM", "959452929499"},
}

func TestFormatMobile(t *testing.T) {
Expand Down Expand Up @@ -143,6 +146,9 @@ var mobWithLLFormatTests = []struct {
{"+51 999 400 500", "PE", "51999400500"},
{"+86 (16) 855-512-329", "CN", "8616855512329"},
{"+383 4 1234999", "XK", "38341234999"},
{"+224629295237", "GN", "224629295237"},
{"+68989657111", "PF", "68989657111"},
{"+959452929499", "MM", "959452929499"},
}

func TestFormatWithLandLine(t *testing.T) {
Expand Down Expand Up @@ -305,6 +311,9 @@ var mobCountryTests = []struct {
{"51907061970", "PE", true},
{"8613855512329", "CN", true},
{"38361234999", "XK", true},
{"224629295237", "GN", true},
{"68989657111", "PF", true},
{"959452929499", "MM", true},
}

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