-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added PhoneNumberMatcher #89
base: main
Are you sure you want to change the base?
Conversation
cmd/phoneserver/go.mod
Outdated
@@ -7,4 +7,4 @@ replace github.com/nyaruka/phonenumbers => ../../ | |||
require ( | |||
github.com/aws/aws-lambda-go v1.13.1 | |||
github.com/nyaruka/phonenumbers v0.0.0-00010101000000-000000000000 | |||
) | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
white spaces?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't have changed. I reset the file to an earlier commit
// international format (with a leading plus, or with the | ||
// international dialing prefix of the specified region). May be | ||
// "ZZ" if only numbers with a leading plus should be considered. | ||
func NewPhoneNumberMatcher(text string, region string) PhoneNumberMatcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it should return the same type as before. And params are different too.
I understand that it wasn't implemented before, but still, everyone should see that this is a breaking change.
CC: @nicpottier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get your point. But I'm not sure what to do here. Currently, the entire PhoneNumberMatcher isn't implemented at all, and the constructor function simply returns nil.
The new function doesn't do anything exciting, except keeping the struct fields private. If I export the "text", "preferredRegion", "leniency" and "maxTries", PhoneNumberMatcher could just be initialized without constructor function. Is that a better solution?
I was trying to use your port of libphonenumber, but the PhoneNumberMatcher had to be implemented. I needed it for my project, so I ported it.