ttacon / libphonenumber

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

Not accepting Mexican phone numbers: 5215563189961 #109

Open NoirKomBatman opened 3 years ago

NoirKomBatman commented 3 years ago

My code:

    sms = strings.TrimSpace("5215563189961")
    if sms == "" {
        return "", errors.WithStack(ErrEmptyPhoneNumber)
    }
    number, err := libphonenumber.Parse(sms, DefaultSMSRegion)
    if err != nil {
        return out, errors.WithStack(err)
    }
    if !libphonenumber.IsValidNumber(number) {
        return out, errors.WithStack(ErrInvalidPhoneNumber)
    }

Getting invalid phone number