ttacon / libphonenumber

golang port of Google's libphonenumber
MIT License
619 stars 105 forks source link

Not accepting UK as a country #92

Open MarkRosemaker opened 4 years ago

MarkRosemaker commented 4 years ago

"UK" does not seem to be accepted as a country, but "GB" is.

When I run:

var num libphonenumber.PhoneNumber
err := libphonenumber.ParseToNumber("0123456789", "GB", &num)
if err != nil {
    fmt.Println("error with GB:", err)
    return
}
err = libphonenumber.ParseToNumber("0123456789", "UK", &num)
if err != nil {
    fmt.Println("error with UK:", err)
    return
}

I get: error with UK: invalid country code

However, according to some resources I've checked, +44 is always referred to the calling code of the United Kingdom.