Is it possible that validateNumberFormat will return err when it cannot find the landcode in patterns?
So change:
pattern, ok := patterns[n[0:2]]
if !ok {
return false, nil
}
to
var CountryNotFound = errors.New("countryNotFound")
pattern, ok := patterns[n[0:2]]
if !ok {
return false, CountryNotFound
}
Is it possible that validateNumberFormat will return err when it cannot find the landcode in patterns?
So change:
to