ttacon / libphonenumber

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

Updated generated code from proto file. Fixes validation failure of valid Indian numbers. #72

Closed shahbazahmed1269 closed 6 years ago

shahbazahmed1269 commented 6 years ago

Fixes issue #71.

Seems like there has been 2 major changes in the proto file since this library was last updated:

  1. Property PhoneNumberDesc.PossibleNumberPattern has been removed. Reference: official release notes. In this PR I have replaced all reference of PhoneNumberDesc.GetPossibleNumberPattern() method with PhoneNumberDesc.GetNationalNumberPattern(). This may have caused side effects in function maybeExtractCountryCode(). But referring to official Java implementation, it appears they are also using GetNationalNumberPattern().

  2. Property PhoneMetadata.LeadingZeroPossible is now deprecated and all references to it have been removed. Reference: official release notes. It seems this property will be deleted soon. I would suggest not using it in this library too.

  3. Default value of type PhoneNumber_CountryCodeSource is changed to PhoneNumber_UNSPECIFIED

Also I would like highlight that above changes may have caused breaking changes to existing methods (as described above) and a couple of tests have started failing.

Please let me know your thoughts. Thanks.


This change is Reviewable